setInterval typescript code example
Example 1: typescript type for intervalId
let timer: ReturnType<typeof setTimeout> = setTimeout(() => { ... });
clearTimeout(timer);
Example 2: javascript setinterval
setInterval(function(){
console.log("Oooo Yeaaa!");
}, 2000);
Example 3: setinterval vs settimeout js
var intervalID = setInterval(alert, 1000);
setTimeout(alert, 1000);
setInterval(function(){
console.log("Oooo Yeaaa!");
}, 2000);
Example 4: js setinterval
function func(){
console.log("Ran")
}
setInterval(func,1000)
Example 5: javascript setinterval
setInterval(function() {
}, 1000);