Multiple ChoiceHard 30s
Closure Pitfall in Loops
Choose the best answer for: creating closures in loops
Options
- 1Closures cannot be created inside loops in JavaScript at all
- 2Only arrow functions work in loops and plain fn cannot close
- 3Use let in for loops to capture per-iteration values in closures
- 4var captures per-iteration values so each closure is distinct
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.