clearinterval javascript

JavaScript
let myVar = setInterval(() => {console.log('bop'), 1000);

clearInterval(myVar); var myVar = setInterval(myTimer, 1000);

function myTimer()
 {
  var d = new Date();
  var t = d.toLocaleTimeString();

   document.getElementById("demo").innerHTML = t;
}

function myStopFunction()
 {
  clearInterval(myVar); // stops interval
}
 var interval = setInterval(function() {
  console.log("Hello World");
}, 1000);

function stopInterval() {
	clearInterval(interval);
}var myInterval = setInterval(function(){console.log("mmk")}, 2000);

clearInterval(myInterval); //stop that intervalvar refreshIntervalId = setInterval(fname, 10000);

/* later */
clearInterval(refreshIntervalId);
Source

Also in JavaScript: