QuestenaÜben und erkennen, was als Nächstes dran ist
Frage 89

After const rate = 3 has initialized successfully, the same scope executes rate = 4. What happens?

  1. A TypeError is thrown because the const binding is being reassignedRichtige Antwort
  2. rate becomes 4 because const controls only scope
  3. A new inner rate binding is created
  4. The assignment silently leaves rate equal to 3

Erklärung

The second assignment attempts to replace the value held by a const binding, so evaluation throws a TypeError. This rule concerns rebinding the name; it should not be generalized into a claim that every object stored in const is deeply frozen.

Mit diesem Test weitermachen

Übung starten
Frage 89: After const rate = 3 has initialized successfully, the same… · JavaScript Fundamentals · Questena