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.
A test for
.reduce()
with a non-numerical start value would be useful to filter out buggy solutions like mine.[0,255,136].reduce(fn,"#")
is perfectly valid (and might convert an RGB value to a CSS RGB value, in this case"#00FF88"
or"#0F8"
).Excuse me???
A normal
reduce()
function should return the default starting value (which is0
) when the array is empty (and the starting value is not passed in). Why is an empty array to be expected to return from it?You sure it is clear to you what this function is designed for?