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