A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Object/isExtensible below:

isExtensible ยท WebPlatform Docs

isExtensible Summary

Returns a value that indicates whether new properties can be added to an object.

Syntax
Object.isExtensible( object )
object
Required. The object to test.
Return Value

true if the object is extensible, which indicates that new properties can be added to the object; otherwise, false.

Examples

The following example illustrates the use of the Object.isExtensible function.


 var obj = { pasta: "spaghetti", length: 10 };

 
 Object.preventExtensions(obj);

 
 obj.newProp = 50;
 document.write(obj.newProp);

 
 undefined
Remarks

For information about how to set property attributes, see Object.defineProperty Function. To obtain the attributes of a property, you can use the Object.getOwnPropertyDescriptor Function.

The following related functions prevent the modification of object attributes.

The following functions return true if all of the conditions marked in the following table are true.

Function Object is extensible? configurable is false for all properties? writable is false for all data properties? Object.isExtensible Yes No No Object.isSealed No Yes No Object.isFrozen No Yes Yes Exceptions

If the object argument is not an object, a TypeError exception is thrown.

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4