bindjs

1.0.0 • Public • Published

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

/bindjs/

    Package Sidebar

    Install

    npm i bindjs

    Weekly Downloads

    0

    Version

    1.0.0

    License

    none

    Last publish

    Collaborators

    • suckgamoni