Skip to content

FullR/bind-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Javascript utility function for binding an array of arguments to a function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published