Question Bank

JavaScript var Loop Closure: Two Explanations Quiz

Difficulty: Medium

The classic var-in-a-for-loop closure trap, explained two ways (shared `i` binding and the IIFE capture fix), plus two companions on the `let` per-iteration binding and a queueMicrotask version of the trap.