Below is the function. I just don't see how the "else" of that ternary operation could ever get executed, but if I'm missing something I'd like to know
wu.autoCurry = function (fn, numArgs) {
numArgs = numArgs || fn.length;
return function () {
if (arguments.length < numArgs) {
return numArgs - arguments.length > 0 ?
wu.autoCurry(wu.curry.apply(this, [fn].concat(toArray(arguments))),
numArgs - arguments.length) :
// in what situation would this line below run?
wu.curry.apply(this, [fn].concat(toArray(arguments)));
}
else {
return fn.apply(this, arguments);
}
};
};
Also here is their curry function:
wu.curry = function (fn /* variadic number of args */) {
var args = ARR_SLICE.call(arguments, 1);
return function () {
return fn.apply(this, args.concat(toArray(arguments)));
};
};