Object.isExtensible

Returns true if new properties can be added to an object.

Syntax

isExtensible(object)

Parameters

Return value

true if new properties can be added to the object, otherwise false.

Examples

let obj = {}
Object.isExtensible(obj)
true
let obj = {}
Object.preventExtensions(obj)
Object.isExtensible(obj)
false
let obj = {}
Object.freeze(obj)
Object.isExtensible(obj)
false