JS Built-ins
ObjectObject.isSealedintermediate

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

πŸ“– 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() β€” frozen implies sealed

Since Object.freeze() makes an object non-extensible and all properties non-configurable (and non-writable), a frozen object is always also sealed.

Challenge: Demonstrate that a frozen object is also sealed.

πŸ’‘ Hints (1)
  • β€’ freeze is a superset of seal