JS Built-ins
ObjectObject.isExtensibleintermediate

Object.isExtensible() β€” after seal

πŸ“– Usage Example
// Check if new properties can be added
const obj = { a: 1 }
Object.isExtensible(obj)             // β†’ true
Object.preventExtensions(obj)
Object.isExtensible(obj)             // β†’ false

Use Object.isExtensible() to check whether new properties can still be added to an object.

Object.isExtensible() after seal

Object.seal(obj) prevents adding or removing properties, making the object non-extensible.

Challenge: Show that a sealed object is not extensible.

πŸ’‘ Hints (1)
  • β€’ seal makes an object non-extensible AND all properties non-configurable