Skip to content

Commit 03a13ea

Browse files
committed
Symbol properties are enumerable (fixes nzakas#352)
1 parent 526d5f4 commit 03a13ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manuscript/06-Symbols.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ console.log(person[firstName]); // "Nicholas"
7474
console.log(person[lastName]); // "Zakas"
7575
```
7676

77-
This example first uses a computed object literal property to create the `firstName` symbol property. The property is created as nonenumerable, which is different from computed properties created using nonsymbol names. The following line then sets the property to be read-only. Later, a read-only `lastName` symbol property is created using the `Object.defineProperties()` method. A computed object literal property is used once again, but this time, it's part of the second argument to the `Object.defineProperties()` call.
77+
This example first uses a computed object literal property to create the `firstName` symbol property. The following line then sets the property to be read-only. Later, a read-only `lastName` symbol property is created using the `Object.defineProperties()` method. A computed object literal property is used once again, but this time, it's part of the second argument to the `Object.defineProperties()` call.
7878

7979
While symbols can be used in any place that computed property names are allowed, you'll need to have a system for sharing these symbols between different pieces of code in order to use them effectively.
8080

@@ -598,7 +598,7 @@ In general, you shouldn't need to define `Symbol.unscopables` for your objects u
598598

599599
## Summary
600600

601-
Symbols are a new type of primitive value in JavaScript and are used to create nonenumerable properties that can't be accessed without referencing the symbol.
601+
Symbols are a new type of primitive value in JavaScript and are used to create properties that can't be accessed without referencing the symbol.
602602

603603
While not truly private, these properties are harder to accidentally change or overwrite and are therefore suitable for functionality that needs a level of protection from developers.
604604

0 commit comments

Comments
 (0)