86
JavaScript handler.preventExtensions() Method
The handler.preventExtensions() method is used to trap the Object.preventExtensions method. When extensions are prevented on an object, new properties can’t be added.
Syntax
Parameters
target: The target object.
Return value
Return a Boolean value.
Browser Support
Chrome | 49 |
Edge | 12 |
Firefox | 22 |
Opera | 36 |
Example 1
Output:
true
Example 2
Output:
true [object Object] false
Example 3
Output:
false false
Next TopicJavaScript handler