Javascript has Object.seal()
to prevent any extensions to an object (and Object.freeze()
to completely freeze it). But it also has Object.preventExtensions()
that seems to do the same job as Object.seal()
, aside from some really small implementation differences.
In what situations would I want/need to use Object.preventExtensions()
rather than Object.seal()
?