Web APIs

clearInterval()

Try the free JavaScript compiler

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

NameTypeDescription
handlehost timer handleHandle 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");
JavaScript Reference