defer()

Defers calling a function until the current call stack is done. Similar to using the global setTimeout function.

This function is valid in v2.0.0 to v2.13.1. This function has been downloaded 27 times.

Parameters

{Function} fn
Function whose call will be deferred until after all other calls in the current stack are done.
{Array=} opt_args Optional, Default:[]
Array of the arguments to be passed to fn.

Returns

{number}
The timeoutID associated with the deferred call. If passed to the global clearTimeout while the function is being deferred the deferred function will not be called.

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.