QuestenaПрактика, после которой понятно, что повторить
Вопрос 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 itselfПравильный ответ

Объяснение

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.

Продолжить работу с тестом

Начать тренировку
Вопрос 96: A for loop declares let i in its initialization. Which… · JavaScript Fundamentals · Questena