cf.completefrontend

Predict the outputHard

What do these timers log when the loop body also increments the let counter?

What does this log?
for (let i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 0);
  i++;
}

The answer

Work out every line it logs, in order. Then check.

Checking your sign-in…