I would like to pass an array as an argument with many values as possible for this method. For example, if I entered [1,2,3]
into add([1,2,3]
, I should receive the sum value of the array.
def add(a, b)
a + b
end
def subtract(a, b)
a - b
end
Since I am new to Ruby, I am not sure how to go about this. Can someone please explain.