Complete the code to add two numbers using the plus operator method.
result = 5.[1](3)
In Ruby, the plus operator + is actually a method. So 5 + 3 is the same as 5.+(3).
Complete the code to check equality using the '==' operator method.
is_equal = 'ruby'.[1]('ruby')
The equality operator == is a method that compares two objects in Ruby.
Fix the error in the code by replacing the blank with the correct operator method to multiply.
product = 4.[1](5)
The multiplication operator * is a method in Ruby used to multiply numbers.
Fill both blanks to create a hash that maps numbers to their squares using operator methods.
squares = {1[1]1, 2[2]4}In Ruby, the hash rocket => is used to map keys to values in a hash.
Fill all three blanks to define a method that adds two numbers using operator methods.
def add(a, b) a[1]b end sum = add([2], [3])
The method uses the '+' operator method to add a and b. We call add(5, 3) to get the sum.