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.
Please use spoiler flag next time, your post was visible in the homepage to people that hadn't solved the kata yet.
If you omit the initialValue, then the initial value of the sum will not be 0, but the first element.
why do you use filtering? it looks like over code. just check it in reduce.
Don't you see that the fork has failed tests when using your suggestion? The code is raising an error if the array is empty. So, yes, that
0
is absolutely necessary if you want the code to be actually correct.wrong
wrong
wrong
wrong
wrong