Answers for "setinterval stop onditional stop"

0

setinterval stop onditional stop

var timesRun = 0;
var interval = setInterval(function(){
    timesRun += 1;
    if(timesRun === 60){
        clearInterval(interval);
    }
    //do whatever here..
}, 2000);
Posted by: Guest on June-13-2020
1

setinterval stop onditional stop

var myTimer = setInterval(...);
clearInterval(myTimer);
Posted by: Guest on June-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language