JSFiddle - React, Tailwind, and code Playground
JavaScript
var loops = 10,
intervalId = setInterval(function () {
// My super logic goes here
console.log(loops);
loops-- <= 0 && (clearInterval(intervalId));
}, 3000);
var loops = 10,
intervalId = setInterval(function () {
// My super logic goes here
console.log(loops);
loops-- <= 0 && (clearInterval(intervalId));
}, 3000);