Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript interval fixed number of times

var x = 0;
var intervalID = setInterval(function () {

   // Your logic here

   if (++x === 5) {
       window.clearInterval(intervalID);
   }
}, 1000);
 
PREVIOUS NEXT
Tagged: #javascript #interval #fixed #number #times
ADD COMMENT
Topic
Name
5+2 =