JS Built-ins
ObjectObject.isExtensiblebeginner

Object.isExtensible() β€” plain object

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

Object.isExtensible(obj) returns true if new properties can be added to the object.

By default, all plain objects are extensible.

Challenge: Implement checkExtensible(obj) that returns whether the object is extensible.

πŸ’‘ Hints (1)
  • β€’ Object.isExtensible() returns true for all plain objects by default