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 has to do with the way that functions are called. If you substitue the addOne(3) with the value assigned to it, you get:
var addOne = add(1); addOne(3) equals add(1)(3);
So the call passes the arguments in the set order.
this assumes that there should be exacly 1 occurrence of each number always. the kata description doesn't say that just that it needs to have all elements from 0 to 9.
The reduce function just takes a collection of values and returns a single value out the end, depending on the function you provide on the inside. In a nut shell, it starts out with what the answer should be, and subtracts the values that are given. In then end, the missing value is what is popped out the other end of the reduce.