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.
squareSum([], [1,2,2]) returns 0 which is fundamentally WRONG!
It should be 9! even after you initialize the default value of reduce to 0 or []
The issue lies within Javascript limitations.
add 0 or [] to reduce, (sum, 0) for example. this Excercise is fundamentally wrong because it returns purposefully zero when given and empty array so, don't be upset about this challenge.
None of these functions solve the problem; for example
squareSum([],[1,2,2]) returns zero, which is WRONG!
it should return 9 and not 0!!!!