Answers for "stopping setInterval"

26

Javascript stop setInterval

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

clearInterval(myInterval); //stop that interval
Posted by: Guest on July-23-2019
0

stopping setInterval

var refreshId = setInterval(function() {
  var properID = CheckReload();
  if (properID > 0) {
    clearInterval(refreshId); //this stops the setInterval
  }
}, 10000);
Posted by: Guest on August-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language