$ cnpm install util-partial
Partially apply a function by pre-filling some of its arguments and without changing the this context.
npm install util-partial --save
var partial = require('util-partial');
var add = function (a, b) {
return a + b;
};
var add5 = partial(add, 5);
add5(10); //=> 15
add5(20); //=> 25
add5(30); //=> 35
Includes a TypeScript type definition.
MIT
Copyright 2013 - present © cnpmjs.org | Home |