minor fixes
This commit is contained in:
parent
b5ea34c83a
commit
6384ccba05
3 changed files with 25 additions and 11 deletions
|
@ -41,6 +41,12 @@ alert( map.size ); // 3
|
|||
|
||||
As we can see, unlike objects, keys are not converted to strings. Any type of key is possible.
|
||||
|
||||
```smart header="`map[key]` isn't the right way to use a `Map`"
|
||||
Although `map[key]` also works, e.g. we can set `map[key] = 2`, this is treating `map` as a plain JavaScript object, so it implies all corresponding limitations (no object keys and so on).
|
||||
|
||||
So we should use `map` methods: `set`, `get` and so on.
|
||||
```
|
||||
|
||||
**Map can also use objects as keys.**
|
||||
|
||||
For instance:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue