From d2e621754e6776c1935c55efbaa1734ee9b8c297 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 23 Jul 2020 09:00:21 +0300 Subject: [PATCH] Update deepFreeze.md --- snippets/deepFreeze.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/deepFreeze.md b/snippets/deepFreeze.md index 67d0007f6..6193d9d72 100644 --- a/snippets/deepFreeze.md +++ b/snippets/deepFreeze.md @@ -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