9951 explained code solutions for 126 technologies


javascriptHow to stop setInterval execution


var interval = setInterval(function() {}, 1000);
clearInterval(interval);ctrl + c
var interval

stores interval ID

setInterval(function() {}, 1000)

declare test interval call of a function every second

clearInterval(interval)

stop previously launched interval by ID