minor fixes
This commit is contained in:
parent
0305a0b864
commit
7dc2a3c79d
1 changed files with 3 additions and 1 deletions
|
@ -1,11 +1,13 @@
|
||||||
|
|
||||||
# Symbol type
|
# Symbol type
|
||||||
|
|
||||||
By specification, object property keys may be either of two primitive types:
|
By specification, only two primitive types may serve as object property keys:
|
||||||
|
|
||||||
- string type, or
|
- string type, or
|
||||||
- symbol type.
|
- symbol type.
|
||||||
|
|
||||||
|
Otherwise, if one uses another type, such as number, it's autoconverted to string. So that `obj[1]` is the same as `obj["1"]` and `obj[true]` is the same as `obj["true"]`.
|
||||||
|
|
||||||
Till now we've been using only strings.
|
Till now we've been using only strings.
|
||||||
|
|
||||||
Now let's explore symbols, see what they can do good for us.
|
Now let's explore symbols, see what they can do good for us.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue