C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
JavaScript Reflect.isExtensible() MethodThe static Reflect.isExtensible() method is used to check if an object is extended or not. This method is similar to Object.isExtensible() but with some difference. Syntax:Reflect.isExtensible(obj) Parameters:Obj: It is the target object which to check if it is extensible. Return value:This method returns a Boolean which indicates whether or not the target is extensible. Exceptions:A TypeError, if the target is not an Object. Browser Support:
Example 1const object = {}; console.log(Reflect.isExtensible(object)); Reflect.preventExtensions(object); console.log(Reflect.isExtensible(object)); Output: true false Example 2const object2 = Object.seal({}); console.log(Reflect.isExtensible(object2)); const object3 = Object.seal({}); console.log(Reflect.isExtensible(object3)); Output: false false Example 3const object = {}; const object1 = {}; console.log(Reflect.isExtensible(object1)); Reflect.preventExtensions(object); console.log(Reflect.isExtensible(object)); Output: true false
Next TopicJavaScript Reflect
|