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.
Suggestion: the description did not say what to do with empty argument list. I think this should be mentioned in the initial task description, as it is a trivial case which still needs to be involved in the logic. Thank you.
The simplest solutions do not pass due to "warning: constant ::Fixnum is deprecated", please fix this
Moderators... the issue between detecting an explicit vs. implicit NaN is a big problem. This kata needs to be fixed or 86'd.
This comment is hidden because it contains spoiler information about the solution
Please help. When submitting I´m failing in one test, how do I see the test in wich I failed?
Here´s my solution:
function sum(){
var total = 0;
for (var i = 0; i < arguments.length; i++)
{
}
return total;
}
This should have a test where the sum equals
0
. It also needs a couple more edge cases, specifically:sum()
) - this will trip up lazyreduce
calls that don't provide a starting value (.reduce(fn)
vs.reduce(fn, 0)
).sum(0)
,sum(1)
,sum(-1)
)Borderline duplicate of http://www.codewars.com/kata/sum-of-all-arguments.