Functions are values, and we can manipulate function values in interesting ways.
Curryingallows us to produce a new function by combining a function and an
argument:
var add1 = add.curry(1);
document.writeln(add1(6)); // 7
Function.method('curry', function ( ) {
var slice = Array.prototype.slice,
args = slice.apply(arguments),
that = this;
return function ( ) {
return that.apply(null, args.concat(slice.apply(arguments)));
};
});
нашел такое в одной книжке
как это вообще работает никто не обьяснит?