apply ( thisArg: Object , argsArray: Array )
The apply() method calls a function with a given this value, and arguments provided as an array (or an array-like object).
Parameters
Name | Type | Description |
---|---|---|
thisArg | Object | The value of this provided for the call to func. |
argsArray | Array | An array-like object, specifying the arguments with which func should be called, or null or undefined if no arguments should be provided to the function. |
Returns
The result of calling the function with the specified this value and arguments.
bind ( thisArg: Object , args: Any) →{ Function }
The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.
Parameters
Name | Type | Description |
---|---|---|
thisArg | Object | The value to be passed as the this parameter to the target function func when the bound function is called. The value is ignored if the bound function is constructed using the new operator. When using bind to create a function (supplied as a callback) inside a setTimeout, any primitive value passed as thisArg is converted to object. If no arguments are provided to bind, the this of the executing scope is treated as the thisArg for the new function. |
args | Any | Arguments to prepend to arguments provided to the bound function when invoking func |
Returns
A copy of the given function with the specified this value, and initial arguments (if provided).
call ( thisArg: Object , args: Any)
The call() method calls a function with a given this value and arguments provided individually.
Parameters
Name | Type | Description |
---|---|---|
thisArg | Object | The value to use as this when calling func. |
args | Any | Arguments for the function. |
Returns
The result of calling the function with the specified this value and arguments