typo + add link to relevant chapter

This commit is contained in:
11un 2019-02-15 10:39:26 -08:00
parent 1b2d3e8010
commit 114c4823fb

View file

@ -1,7 +1,7 @@
The method can take all enumerable keys using `Object.keys` and output their list.
To make `toString` non-enumerable, let's define it using a property descriptor. The syntax of `Object.create` allows to provide an object with property descriptors as the second argument.
To make `toString` non-enumerable, let's define it using a property descriptor. The syntax of `Object.create` allows us to provide an object with property descriptors as the second argument.
```js run
*!*
@ -27,3 +27,5 @@ alert(dictionary); // "apple,__proto__"
```
When we create a property using a descriptor, its flags are `false` by default. So in the code above, `dictionary.toString` is non-enumerable.
See the the chapter on [Property flags and descriptors](http://javascript.info/property-descriptors) for review.