Ruby on Rails Thursday, August 29, 2013

Dheeraj Kumar wrote in post #1119995:
> def array_sum(array1 = [], array2 = [])
> array1 + array2
> end
>
> array_sum([1,2,3], [4,5,6])
> => [1, 2, 3, 4, 5, 6]
>
>
> --
> Dheeraj Kumar

Is there a reason why when i would run a test it would say -1 arguments
instead of 2? You had listed two (array1 = [], array2= []), I have never
actually gotten - arguments before with the spec test.

thanks!

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0a873e3de591a2bfb3551dc08c212449%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment