Hint
var leaks out of block scope. All closures share one variable.
for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 0);
}3 3 3
Explanation: var is function-scoped, not block-scoped. All 3 callbacks close over the SAME i variable. By the time they run, the loop has finished and i = 3.
Key Insight: var leaks out of block scope. All closures share one variable.