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.
Try using console.log(arr) to see what is getting passed to the test values. You may have to account for unexpected types of input.
Try using console.log(arr) to see what is getting inserted into each test. The results might be surprising. ;-)
I now realize the || statements were totally unnecessary and submitted a refactored version... ;)
Got it - that helped. thanks!
Agree. I am going through every single 7kyu exercise right now and this one is excessively more difficult than any other I've tried so far. At least 6kyu. Maybe 5, although I wouldn't know because I haven't done any 5s yet...
This comment is hidden because it contains spoiler information about the solution
Ah now it makes perfect sense. Thanks!!
This solution looks quite clever; I wish I understood it! Can someone explain to me how it works? I sort of understand how reduce works and see the sum of the array is 45, but I still seem to be fuzzy on what is going on with these types of solution.