Hint
var in loops creates one shared binding. Every closure captures the same variable, not its value at that iteration.
for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 0);
}3 3 3
Explanation: var is function-scoped — all three callbacks close over the same i. By the time they run, the loop has finished and i is 3.
Key Insight: var in loops creates one shared binding. Every closure captures the same variable, not its value at that iteration.