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.
This comment is hidden because it contains spoiler information about the solution
Please use spoiler flag next time, your post was visible in the homepage to people that hadn't solved the kata yet.
This comment is hidden because it contains spoiler information about the solution
If you omit the initialValue, then the initial value of the sum will not be 0, but the first element.
While this is a good solution I wouldn't say it's 'best practice' since the naming inside of the lights object is kind of confusing.
Green is Yellow is not what someone would expect right?
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.why?
why?
why?
why?
how so?
wrong
wrong
wrong
Loading more items...