API Docs for: 0.0.8
Show:

Function Class

Simple function helpers.

Item Index

Methods

Methods

partial

(
  • method
)
Function

Partially apply a function by filling in any number of its arguments, without changing its dynamic this value. A close cousin of Function.prototype.bind.

Parameters:

  • method Function

    Method to call with the arguments on final evaluation.

Returns:

Example:

function add(a, b) {
                                              return a + b;
                                            }
                                            
                                            var add10To = partial(add, 10);
                                            var result = add10To(9);
                                            // result is 19