What value is printed with the following code?
let x = 0;
const interval = setInterval(() => {
x++;
if (x > 2) {
clearInterval(interval);
console.log(x);
}
}, 1000);
What value is printed with the following code?
let x = 0;
const interval = setInterval(() => {
x++;
if (x > 2) {
clearInterval(interval);
console.log(x);
}
}, 1000);