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

Which statements correctly distinguish const reassignment from object mutation? Select all that apply.

  1. Assigning a new value to an initialized const binding throws a TypeErrorՃիշտ պատասխան
  2. Changing any property of an object held by const always throws
  3. Changing an element of a mutable array held by const is not reassignmentՃիշտ պատասխան
  4. const recursively freezes every nested object

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

Replacing the value of an initialized const binding is a rebinding attempt and throws a TypeError. Changing a property or array element of a mutable object held by that binding is not rebinding, so const alone does not make nested data immutable.

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

Սկսել վարժանքը
Հարց 111: Which statements correctly distinguish const reassignment… · JavaScript Fundamentals · Questena