May 2011
Intermediate to advanced
1096 pages
40h 54m
English
Object.isExtensible() — can new properties be added to an object?
ECMAScript 5
Object.isExtensible(o)
oThe object to be checked for extensibility
true if the object can be
extended with new properties, or false if it cannot.
An object is extensible (or extendable) if it can have new properties added to it. All objects are extendable when they are created and remain that way unless they are passed to Object.preventExtensions(), Object.seal(), or Object.freeze().
Note that this is not a method to be invoked on an object: it is a global function and you must pass an object to it.
varo={};// Start with a newly-created objectObject.isExtensible(o)// => true: it is extendableObject.preventExtensions(o);// Make it non-extendableObject.isExtensible(o)// => false: now it is not extendable
Read now
Unlock full access