External: Function

Function

The built in Function Object
Source:
function.js, line 9
See:

Methods

bind(that)

Binds this function to the given context by wrapping it in another function and returning the wrapper.

Whenever the resulting "bound" function is called, it will call the original ensuring that this is set to context.

Also optionally curries arguments for the function.

Parameters:
Name Type Argument Description
that Object the object to bind to.
arguments... <optional>
Optional additional arguments to curry for the function.
Source:
function.js, line 31
See:
Example
// Ensure that our callback is triggered with the right object context (this):
myObject.onComplete(this.callback.bind(this));

defer(context) → {Number}

Executes a function as soon as the interpreter is idle (stack empty).
Parameters:
Name Type Argument Description
context Object The execution context of the deferred function.
arguments... <optional>
Optional additional arguments to carry for the function.
Source:
function.js, line 75
Returns:
id that can be used to clear the deferred function using clearTimeout
Type
Number
Example
// execute myFunc() when the stack is empty,
// with the current context and 'myArgument' as parameter
myFunc.defer(this, 'myArgument');
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:40+08:00 using the DocStrap template modified by codename-.