This commit is contained in:
Ilya Kantor 2017-12-17 00:04:46 +03:00
parent 51aff82819
commit 6e4427dcf0
2 changed files with 10 additions and 8 deletions

View file

@ -228,7 +228,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 exist a way to make objects treat `__proto__` as a regular property, we'll cover it later, but first we need to know more about objects to understand it.
There exist a way to make objects treat `__proto__` as a regular property, we'll cover it later, but first we need to know more about objects to understand it.
There's another data structure [Map](info:map-set-weakmap-weakset), that we'll learn in the chapter <info:map-set-weakmap-weakset>, which supports arbitrary keys. Also
````
@ -411,8 +411,8 @@ So, "49" is an integer property name, because when it's transformed to an intege
```js run
// Math.trunc is a built-in function that removes the decimal part
alert( String(Math.trunc(Number("49"))) ); // "49", same, integer property
alert( String(Math.trunc(Number("+49"))) ); // "49", not same ⇒ not integer property
alert( String(Math.trunc(Number("1.2"))) ); // "1", not same ⇒ not integer property
alert( String(Math.trunc(Number("+49"))) ); // "49", not same "+49" ⇒ not integer property
alert( String(Math.trunc(Number("1.2"))) ); // "1", not same "1.2" ⇒ not integer property
```
````