7/19 new method called add that takes two numbers as arguments


#1

def add(*n)
return n+n
end

I don't understand why it says that it's not the result of adding two numbers together ?


#2

i found the answer aah
def add(*n)
add.each { |n| return "n+n" }
end


#3

Yeah, your original code wouldn't work if there were more than two values for n


#4

This seemed to work for me.

def add(*n)
return add ( 4 + 6)
end

more simplistic in my opinion.