1.1.1 • Published 8 years ago
@f/apply v1.1.1
apply
Faster apply than the native Function.prototype.apply
Installation
$ npm install @f/apply
Usage
var apply = require('@f/apply')
apply(add, [1, 2]) // => 3
function add (one, two) {
return one + two
}
API
apply(fn, args)
fn
- The function to invokeargs
- The argument list as an array
Returns: return of invoked fn
Performance
Here's the jsperf. In Chrome, it's roughly 2.5x faster than the native apply.
License
MIT