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.
Hi, I'm a bit unclear on the exact specification. What should it do if the number of arguments supplied when calling the returned function is higher than the number of "defaultless" arguments, but lower than the total number of arguments? Should it start filling them in from the first argument, or first fill in the defaultless ones and somehow proceed with the others?
Example: if I have a function add4(a, b, c, d) { return a + b + c + d; } and add4WithDefaults = defaultArguments(add4, {a:1, c:3}); , then what should add4WithDefaults(2, 4, 5) return? Should in this case make it a = 1, b = 2, c = 3, d = 4 and disregard the third argument? Or should it be a = 2, b = 4, c = 3 and d = ??? (resulting in NaN)? Neither seems right.