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.
I was thinking the same thing... I think that it's because: "Your reducer function's returned value is assigned to the accumulator, whose value is remembered across each iteration throughout the array, and ultimately becomes the final, single resulting value." So, even though
prev
is never explictly reassigned, each time it hitsreturn
whatever is returned there is assigned toprev
for the next time it iterates through the array.