1var myInterval = setInterval(function(){console.log("mmk")}, 2000);
2
3clearInterval(myInterval); //stop that interval
1let myVar = setInterval(() => {console.log('bop'), 1000);
2
3clearInterval(myVar);
1let autoScroll = window.setInterval(() => {
2 if (window.scrollY >= document.getElementById('second-part').scrollHeight) {
3
4 clearInterval(autoScroll);
5 }
6
7 window.scrollBy(0, 10);
8}, 25);
1var refreshIntervalId = setInterval(fname, 10000);
2/* later */
3clearInterval(refreshIntervalId);
4// See the docs for setInterval() and clearInterval()