1.0.0 • Published 9 years ago

bind-array v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

Bind-Array

Utility function for binding an array of arguments to a function. Same as apply but without invoking the function.

Usage

var bindArray = require("bind-array");

function foo(a, b, c, d, e) {
    console.log(this, a, b, c, d, e)
}

var bound = bindArray(foo, "this arg", [1, 2, 3, 4, 5]);
bound(); // prints "this arg", 1, 2, 3, 4, 5

API

bindArray(fn:function, thisArg:any, args:array or args:arguments) : function