delay()

Calls a function after a given amount of time. This is very similar to the global setTimeout function.

This function is valid in v2.0.0 to v2.14.0. This function has been downloaded 45 times.

Parameters

{Function} fn
Function to call after a certain amount of time.
{number} msDelay
Delay in milliseconds before fn is actually called.
{Array=} opt_args Optional, Default:[]
An array of the arguments to pass to fn.

Returns

{number}
The timeoutID corresponding to this delayed function call. The global clearTimeout function can be used to cancel this delayed call.

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.