Reputation: 2411
preventExtensions()
method prevents extensible object from extending, isn't there way to redo it? Or isn't there a method or trick to convert non-extensible object to extensible object. I wanted to know whether it is possible or not.
Upvotes: 1
Views: 315
Reputation: 3289
No. You can still modify the prototype, but not the object itself.
From MDN @ https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/preventExtensions:
If there is a way to turn an extensible object to a non-extensible one, there is no way to do the opposite in ECMAScript 5
Upvotes: 1