Class Func
Utility for Functions
Defined in: function.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Func()
|
Method Attributes | Method Name and Description |
---|---|
<static> |
Func.bindFixed(fn, thisObject)
Creates a new function that, when called, uses the provided
this value and arguments. |
<static> |
Func.bindRight(fn, thisObject)
Creates a new function that, when called, uses the provided
this value
and appends the provided arguments. |
Method Detail
<static>
{function}
Func.bindFixed(fn, thisObject)
Creates a new function that, when called, uses the provided
this
value and arguments.
At the contrary of Function.prototype.bind
, any parameter provided at the call is
ignored.
- Parameters:
- {function} fn
- The function to bind
- {*} thisObject
- The object to pass as the `this` value
- {*} ...args
- the series of parameters to pass to the new function
- Returns:
- {function} the new Function
<static>
{function}
Func.bindRight(fn, thisObject)
Creates a new function that, when called, uses the provided
this
value
and appends the provided arguments. Note that it differs from Function.prototype.bind which
prepends the provided arguments (that is why this function is called bindRight).
- Parameters:
- {function} fn
- The function to bind
- {*} thisObject
- The object to pass as the
this
value - {*} ...args
- the series of parameters to pass to the new function
- Returns:
- {function} the new function