clearTimeout
Cancel a scheduled callback.
js
clearTimeout(id)Arguments
| Argument | Type | Meaning |
|---|---|---|
id | number | ID returned by setTimeout. |
Returns
No return value (undefined).
Example
js
const id = setTimeout(() => console.log("later"), 1000);
clearTimeout(id);