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

A program executes let score = 1 and later score = 2 in the same valid scope. What is the result?

  1. score remains 1 because later assignment is ignored
  2. A SyntaxError occurs because let permits only initialization
  3. A new nested binding named score is created automatically
  4. The existing score binding is reassigned and its value becomes 2Ճիշտ պատասխան

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

A let binding permits assignment of a new value after its declaration, so score becomes 2. The belief that let makes a value immutable confuses block scoping with the separate reassignment restriction associated with const.

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

Սկսել վարժանքը
Հարց 88: A program executes let score = 1 and later score = 2 in the… · JavaScript Fundamentals · Questena