JavaScript Developer — Medium
Key points
- Using let creates a new binding for i in each iteration
- var creates a single binding shared across all iterations
- This prevents the closure from capturing the final value of i
Ready to go further?
Related questions
