Web APIs
setTimeout()
Requests a delayed callback from the host. Delay is not an exact execution deadline; the returned handle is host-specific.
Formal Syntax & Structure
javascript syntaxjavascript
setTimeout(callback, delay, ...args)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| callback | function | Scheduled operation. |
| delay | number | Requested delay in milliseconds. |
| args | any[] | Arguments supplied to the callback. |
Return Value
host-specific handle
Browser ID or host timer object.
Working Example
Example Snippetjavascript
setTimeout(() => console.log("later"), 0);console.log("now");