What is the opposite of Object.freeze
or Object.seal
? Is there a function that has a name such as detach?
There is no way to do this, once an object has been frozen there is no way to unfreeze it. This is technically correct as far as mutating the existing object. However, you can copy/clone the existing object and mutate it's properties now.
With Object. freeze() , new changes have no effect on the frozen object. However, the seal() method allows modifying existing properties. This means that while you cannot add new properties or remove existing ones, you can make changes.
Object. seal() allows changes to the existing properties of an object whereas Object. freeze() does not allow so. Object. freeze() makes an object immune to everything even little changes cannot be made.
Object. freeze works on values, and more specifically, object values. It makes an object immutable, i.e. you cannot change its properties. Basically, const is the new var ; it's just block-scoped and prevents reassignment.
There is no way to do this, once an object has been frozen there is no way to unfreeze it.
Source
Freezing an object is the ultimate form of lock-down. Once an object has been frozen it cannot be unfrozen – nor can it be tampered in any manner. This is the best way to make sure that your objects will stay exactly as you left them, indefinitely
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With