Update deepFreeze.md
This commit is contained in:
@ -6,7 +6,7 @@ tags: object,recursion,intermediate
|
||||
Deep freezes an object.
|
||||
|
||||
Use `Object.keys()` to get all the properties of the passed object, `Array.prototype.forEach()` to iterate over them.
|
||||
Call `Object.freeze(obj)` recursively on all properties, checking if each object is frozen using `Object.isFrozen()` and applying `deepFreeze()` as necessary.
|
||||
Call `Object.freeze(obj)` recursively on all properties, checking if each one is frozen using `Object.isFrozen()` and applying `deepFreeze()` as necessary.
|
||||
Finally, use `Object.freeze()` to freeze the given object.
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user