QuestenaPractice that shows what to review next
Question 96

A for loop declares let i in its initialization. Which scope owns that i binding?

  1. The whole program
  2. The nearest function regardless of nested blocks
  3. The surrounding block even after the loop finishes
  4. The for loop itselfCorrect answer

Explanation

A let binding introduced by the for initializer is scoped to that loop, including the loop body where appropriate. It does not become a binding of the surrounding block after the loop ends, and no closure-timing premise is needed here.

Continue with this test

Start practice
Question 96: A for loop declares let i in its initialization. Which… · JavaScript Fundamentals · Questena