JavaScript: Object.isExtensible

By Xah Lee. Date: . Last updated: .
Object.isExtensible(obj)
Return true if a object obj is an object and is extensible, else false. [see Object Type] Extensible means properties can be added. [see Prevent Adding Property]
// check if a object is extensible

console.log( Object.isExtensible( {} )); // true
// return false for non object
console.log( Object.isExtensible( 3 )); // false

Reflect.isExtensible

Tip: Better is Reflect.isExtensible . It throws error if argument is not object.

BUY
ΣJS
JavaScript in Depth

JS Obj Reference

Object Object

prototype