What will be the output of the code?
let count = 0;
const intervalID = setInterval(() => {
console.log(count);
count++;
if (count === 5) {
clearInterval(intervalID);
}
}, 1000);
What will be the output of the code?
let count = 0;
const intervalID = setInterval(() => {
console.log(count);
count++;
if (count === 5) {
clearInterval(intervalID);
}
}, 1000);