minor fixes

This commit is contained in:
Ilya Kantor 2020-01-19 20:32:27 +01:00
parent b5ea34c83a
commit 6384ccba05
3 changed files with 25 additions and 11 deletions

View file

@ -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: