Merge pull request #2191 from vsemozhetbyt/patch-2

Clarify a bit ambiguous wording in 1.5.7
This commit is contained in:
Ilya Kantor 2020-11-24 23:11:43 +03:00 committed by GitHub
commit c066feac6c
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. 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`" ```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. So we should use `map` methods: `set`, `get` and so on.
``` ```