JS Built-ins
ObjectObject.isSealedbeginner

Object.isSealed() β€” after Object.seal

πŸ“– Usage Example
// Check if an object is sealed
const obj = { a: 1 }
Object.isSealed(obj)    // β†’ false
Object.seal(obj)
Object.isSealed(obj)    // β†’ true

Use Object.isSealed() to check whether an object's properties cannot be added or removed (though values may still change).

Object.isSealed() after seal

Object.seal() prevents adding new properties and makes all existing properties non-configurable. Writable properties can still be written to.

Challenge: Seal an object and verify it is sealed, but check that existing properties can still be modified.

πŸ’‘ Hints (1)
  • β€’ Sealing prevents structural changes but not value changes for writable properties