bind()

Creates a function that when called will call fn with this referring to objThis and any values in opt_args be passed as the first arguments to fn.

This function is valid in v2.1.0 to v2.14.0. This function has been downloaded 41 times.

Parameters

{Function} fn
Function to invoke when the return function is called.
{*} objThis
The value to which this will refer unless undefined or null is given.
{Array=} opt_args Optional, Default:[]
Array of arguments to prepend to the arguments passed to fn when the returned function is called.

Returns

{Function}
A function that when called will call fn with this referring to objThis and any values in opt_args be passed as the first arguments to fn.

Required Function

This function requires the following function which is included automatically:

  • slice()
    Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.