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

Spot the false statement about primitive value immutability.

  1. A string operation cannot alter the original string value
  2. A number value cannot be changed internally
  3. A variable can later hold a different primitive value
  4. Reassigning a variable mutates its old primitive valueՃիշտ պատասխան

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

A variable may be assigned a different primitive value, but that operation changes the binding rather than the original primitive. Therefore the claim that reassignment mutates the old value confuses rebinding with mutation.

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

Սկսել վարժանքը
Հարց 5: Spot the false statement about primitive value immutability. · JavaScript Fundamentals · Questena