setTimeout
function setTimeout(
callback,
delay, ...
args): number;
Set a timer which executes a function or specified piece of code once the timer expires.
Parameters
| Parameter | Type | Description |
|---|---|---|
| (... | A function to be executed after the timer expires. |
|
| (Optional) The milliseconds that the timer should wait before the function is executed, by default is |
... |
| (Optional) Additional arguments which are passed through to the function. |
Returns
number
The ID (integer) which identifies the timer created.
Throws
Throws TypeError if callback is not a function, or delay is neither a number or undefined.