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.
If you omit the initialValue, then the initial value of the sum will not be 0, but the first element.
why?
wrong
Using an initial value is unnecessarry since it's zero.
This leads to an extra circle through the array which is not needed here.
If you omit the initial value you will therefore save one circle.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#how_reduce_works_without_an_initial_value
This got a good laugh out of me.
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
However it has the benefit of only resorting to reduce, a function that can do anything, to perform its textbook application, hence better conveying intent. Maintanability saves more money than micro-optimization.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
After doing the encode part easily I thought the decode part would follow. Big mistake. Sunday afternoon gone. I give up for now!
This comment is hidden because it contains spoiler information about the solution
Most rewarding kata I've completed. Thank you.
Stuck down to
9789... I might have to rethink my approach D:Loading more items...