Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
API | Description |
|---|---|
Sets a timer to execute the registered callback function when the timer expires and returns the timer ID. The timer ID can be passed to clearTimeout to cancel the timer. | |
Cancels the timer set by the setTimeout() method. | |
Sets a timer to execute the registered callback function based on a specified period (in milliseconds) and returns the timer ID. The timer ID can be passed to clearInterval to cancel the timer. | |
Cancels the timer set by the setInterval() method. |
Sets a timer to execute the registered callback function when the timer expires and returns the timer ID. The timer ID can be passed to clearTimeout to cancel the timer.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function. |
delay | number | Yes | Delay, in milliseconds, before the function is called. |
rest | any | No | Additional parameters (param1,param2,…paramN) that are passed to the callback function. |
- var id = setTimeout(
- function() {console.log("setTimeout");},
- 666,
- 'any'
- )
Cancels the timer set by the setTimeout() method.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
timeoutID | number | Yes | Timer ID. |
- clearTimeout(666)
Sets a timer to execute the registered callback function based on a specified period (in milliseconds) and returns the timer ID. The timer ID can be passed to clearInterval to cancel the timer.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function. |
delay | number | Yes | Delay, in milliseconds, before the function is called. |
rest | any | No | Additional parameters (param1,param2,…paramN) that are passed to the callback function. |
- var id = setInterval(
- function() {console.log("setInterval");},
- 666,
- 'any'
- )
Cancels the timer set by the setInterval() method.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
intervalID | number | Yes | Timer ID. |
- clearInterval(666)