From 101f8ba62380a7ceaebffefd79c90d801258d3fe Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Thu, 19 Jul 2018 23:42:11 +0300 Subject: [PATCH] closes #440 --- 1-js/04-object-basics/01-object/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/04-object-basics/01-object/article.md b/1-js/04-object-basics/01-object/article.md index 2b6382b8..3014f896 100644 --- a/1-js/04-object-basics/01-object/article.md +++ b/1-js/04-object-basics/01-object/article.md @@ -224,7 +224,7 @@ That can become a source of bugs and even vulnerabilies if we intent to store ar In that case the visitor may choose "__proto__" as the key, and the assignment logic will be ruined (as shown above). -There is a way to make objects treat `__proto__` as a regular property, which we'll cover later, but first we need to know more about objects. +There is a way to make objects treat `__proto__` as a regular property, which we'll cover later, but first we need to know more about objects. There's also another data structure [Map](info:map-set-weakmap-weakset), that we'll learn in the chapter , which supports arbitrary keys. ```` @@ -701,7 +701,7 @@ alert(clone.sizes.width); // 51, see the result from the other one To fix that, we should use the cloning loop that examines each value of `user[key]` and, if it's an object, then replicate its structure as well. That is called a "deep cloning". -There's a standard algorithm for deep cloning that handles the case above and more complex cases, called the [Structured cloning algorithm](https://w3c.github.io/html/infrastructure.html#internal-structured-cloning-algorithm). In order not to reinvent the wheel, we can use a working implementation of it from the JavaScript library [lodash](https://lodash.com), the method is called [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep). +There's a standard algorithm for deep cloning that handles the case above and more complex cases, called the [Structured cloning algorithm](http://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data). In order not to reinvent the wheel, we can use a working implementation of it from the JavaScript library [lodash](https://lodash.com), the method is called [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep).