set timeout vs set interval code example
Example 1: difference between setTimeout() and setInterval()
.setTimeout()
.setInterval()
Example 2: setinterval vs settimeout js
var intervalID = setInterval(alert, 1000);
setTimeout(alert, 1000);
setInterval(function(){
console.log("Oooo Yeaaa!");
}, 2000);
Example 3: js setinterval vs settimeout
var intervalID = setInterval(alert, 1000);
setTimeout(alert, 1000);
Example 4: setinterval vs settimeout
setTimeout allows us to run a function once after the interval of time.
setInterval allows us to run a function repeatedly, starting after the interval of time, then repeating continuously at that interval.