JavaScript Time | stop timer | JavaScript set interval | js timer

Опубликовано: 02 Октябрь 2024
на канале: Coding Study Point
579
like

In this video JavaScript Timer
How to Stop the Execution?
The clearInterval() method stops the executions of the function specified in the setInterval() method.

window.clearInterval(timerVariable)
The window.clearInterval() method can be written without the window prefix.

The clearInterval() method uses the variable returned from setInterval():

let myVar = setInterval(function, milliseconds);
clearInterval(myVar);