Object.freeze() and Object.seal() serve as ways to prevent a JavaScript object from being altered. Both methods perform a shallow freeze/seal on the object. nested objects and arrays are not frozen or sealed and can be mutated. To prevent this, you can deep freeze objects, as described in this related article.
2 Comments
Sort: