From 746fe5f2b6e23666627581c6822665d54eff246e Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 19 Jul 2019 19:30:19 +0300 Subject: [PATCH] minor --- 1-js/04-object-basics/01-object/article.md | 5 +++-- 1 file changed, 3 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 fd2157db..caf5ed60 100644 --- a/1-js/04-object-basics/01-object/article.md +++ b/1-js/04-object-basics/01-object/article.md @@ -129,7 +129,7 @@ let key = "likes birds"; user[key] = true; ``` -Here, the variable `key` may be calculated at run-time or depend on the user input. And then we use it to access the property. That gives us a great deal of flexibility. +Here, the variable `key` may be calculated at run-time or depend on the user input. And then we use it to access the property. That gives us a great deal of flexibility. For instance: @@ -145,7 +145,7 @@ let key = prompt("What do you want to know about the user?", "name"); alert( user[key] ); // John (if enter "name") ``` -The dot notation cannot be used in a similar way. +The dot notation cannot be used in a similar way: ```js run let user = { @@ -235,6 +235,7 @@ That can become a source of bugs and even vulnerabilities if we intend to store 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's also another data structure [Map](info:map-set-weakmap-weakset), that we'll learn in the chapter , which supports arbitrary keys. ````