JS Built-ins
ObjectObject.isSealedbeginner

Object.isSealed() β€” plain object

πŸ“– 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()

Object.isSealed(obj) returns true if the object is non-extensible AND all properties are non-configurable.

A plain object is not sealed by default.

Challenge: Implement checkSealed(obj) that returns whether the object is sealed.

πŸ’‘ Hints (1)
  • β€’ Every frozen object is sealed, but not every sealed object is frozen