clearInterval() Function

The clearInterval() function cancels an existing repeating timer created by setInterval().

Syntax

clearInterval(timer)

Parameters

Return value

None (undefined).

Example

> timer = setInterval(() => console.log("hello world"), 100);
undefined
hello world
hello world
hello world
> clearInterval(timer)
undefined

References