QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 85

A let binding named total is declared inside an if block. Where is that binding accessible?

  1. Inside that block and its nested scopesՃիշտ պատասխան
  2. Everywhere in the containing function after the block
  3. Only on the single line where it is declared
  4. In every function called from that block

Բացատրություն

A let declaration creates a block-scoped binding, so total is available within that block and scopes nested inside it. Treating it as function-wide confuses let with the function-scoped behavior of var declarations inside functions.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 85: A let binding named total is declared inside an if block.… · JavaScript Fundamentals · Questena