attempt()

Attempts to call a function if one exists at the given path starting at the given root object.

This function is valid in v2.8.0 to v2.22.1. This function has been downloaded 27 times.

Parameters

{*} root
The root object for which to begin traversing the path the find the corresponding function to be called.
{string|Array} path
If this is a string it represents the name of root's function that will be called. If this is an array it represents a path to the object and then the underlying function that will be called.
{…*=} opt_argX Optional
Zero or more arguments to be passed to the function at path.

Returns

{*}
If there is a function found at path under root it will be executed and the return value will be returned. Otherwise undefined is returned.

Required Function

This function directly 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.