Web APIs
clearInterval()
Stops a pending repeating timer from scheduling future invocations; does not reverse already completed callback effects.
Formal Syntax & Structure
javascript syntaxjavascript
clearInterval(handle)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| handle | host timer handle | Handle returned by setInterval. |
Return Value
undefined
No return value.
Working Example
Example Snippetjavascript
const id=setInterval(()=>console.log("unexpected"),1); clearInterval(id); console.log("stopped");