Function Function.bind (Mixed bind_obj, [Mixed args = null]) vs. 1.1.0 Full+Lite

The bind function allows binding an object to a function. Therefor, this will refer to the binding object in the function. You can also pass arguments to the function.

Parameters

Mixed bind_obj Required vs. 1.1.0 Full+Lite
The object in which to bind the function to.
Mixed args (Optional - Default: null) vs. 1.1.0 Full+Lite
The arguments to pass to the function when binding it to an object. To pass more than one arguments, use an array.

Return

Function () vs. 1.1.0 Full+Lite
The function that was binding to the object.

Examples

Using Function.bind(obj, args)
Demo:
No Arguments:


Default Arguments:


Passed Arguments (changed to uppercase):


Default Arguments plus Passed Arguments (default arguments are last in the arguments list):