Object.preventExtensions( obj )
Parameters: This method accepts single parameter as mentioned above and described below:
- obj: This parameter holds the object which must be made non-extensible.
Return value: This method returns the object after making it non-extensible.
TypeError: Cannot define property prop1, object is not extensible
true false false false
Supported Browsers: The browsers supported by Object.preventExtensions() method are listed below:
- Chrome 6 and above
- Edge 12 and above
- Firefox 4 and above
- Internet Explorer 9 and above
- Opera 12 and above
- safari 5.1 and above