Clarify a bit ambiguous wording in 1.5.7

This commit is contained in:
Vse Mozhe Buty 2020-10-12 19:22:13 +03:00 committed by GitHub
parent 1431a2552e
commit 104bee3ccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ 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).
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 (only string/symbol keys and so on).
So we should use `map` methods: `set`, `get` and so on.
```