1.0.0 • Published 11 years ago
bindjs v1.0.0
bind.js
Simple extension of Function.prototype.bind().
Supported platforms
- Web
- node.js ( npm install bindjs )
Usage
require('./bind');
function test(a, b, c, d) {
console.log(a);
console.log(b);
console.log(c);
console.log(d);
console.log();
}
test.bind(null, 9)(1, 2, 3); // 9 1 2 3
test.bind(null, $0, 9, $1, $2)(1, 2, 3); // 1 9 2 3
var obj = {foo: 1, bar: 2};
test.bind(null, $this).call(obj, 1, 2, 3); // { foo: 1, bar: 2 } 1 2 3
1.0.0
11 years ago