Answers for "function loop setTimeout stop"

16

stop settimeout

var myVar;

function myFunction() {
  myVar = setTimeout(function(){ alert("Hello"); }, 3000);
}

function myStopFunction() {
  clearTimeout(myVar);
}
Posted by: Guest on February-19-2020
0

break loop timeout javascript

var keepCalling = true;

setTimeout(function () {
  keepCalling = false;
}, 10000);

while ( keepCalling ) {
  // do something
}
Posted by: Guest on February-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language