bind-append
v1.0.1
Published
Creates a new function with the given `this` and the appended arguments.
Maintainers
Readme
bind-append
Creates a new function with the given
thisand the appended arguments.. It works like Function.prototype.bind
.. but does not pollute Function.prototype
... and appends the arguments to the new Function arguments
.... instead of prepending them
install
npm i -S bind-appenduse
var bindAppend = require('bind-append');
function linear(x, a, b) {
return a + b * x;
}
var fn = bindAppend(linear, null, 1, 2);
assert.equal(fn(0), 1);
assert.equal(fn(1), 3);
assert.equal(fn(2), 5);
test
npm testAPI
bindAppend(function, thisArg[, arg1[, arg2[, ...]]])
license
MIT
author
Andi Neck @andineck
