Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I actually disagree.
this looks very nice
Sorry, I seemed to have missed an email detailing this comment.
Your solution is close but realize that Array.map will return an array with the block executed on each element of the array!
So you should be making sure to return the
sum
would be a good idea.that would only work on modern browsers..
This comment is hidden because it contains spoiler information about the solution
.each
will only allow 1 parameter for the block so you cannot do:numbers.each {|total, i| total += i}
You can do
numbers.each { |i| total += i }
but you'll need total be done in some other way.Whenever I test my code, I get the following error: Any help would be grealty appreciated.
+': nil can't be coerced into Fixnum (TypeError) from
block in sum'from
each' from
sum'from `
'