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.
It's another case: A sum is initialized with 0 and then all elements are added to the sum. The average, on the other hand, is defined by the sum of all elements divided by the number of all elements, which would mean 0 (the sum) divided by 0 (the number of elements). And division by 0 means: NaN.
Why should that be better? If you have no values, you can't build an average, so you need to return a special value, since 0 is a valid result for values.