What is the output of the following code?
let count = 0;
const interval = setInterval(() => {
if (count < 3) {
console.log(count++);
} else {
clearInterval(interval);
}
}, 1000);
What is the output of the following code?
let count = 0;
const interval = setInterval(() => {
if (count < 3) {
console.log(count++);
} else {
clearInterval(interval);
}
}, 1000);