Skip to content

QuizNot attempted

Mutability matrix

After Object.seal(obj), which operations still work?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Changing the value of an existing property
  • Object.seal makes the object non-extensible and every property non-configurable, but leaves values writable, so changing an existing value still works.
  • Not adding: sealed objects are non-extensible.
  • Not deleting: non-configurable properties can't be deleted.
  • Not redefining as non-enumerable: changing attributes requires configurable.
  • freeze additionally makes values non-writable
  • check with Object.isSealed/isFrozen.