Skip to content

Commit ff13ed0

Browse files
committed
minor fixes
1 parent 730b28e commit ff13ed0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

article.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ alert( map.size ); // 3
4141

4242
As we can see, unlike objects, keys are not converted to strings. Any type of key is possible.
4343

44+
```smart header="`map[key]` isn't the right way to use a `Map`"
45+
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).
46+
47+
So we should use `map` methods: `set`, `get` and so on.
48+
```
49+
4450
**Map can also use objects as keys.**
4551
4652
For instance:

0 commit comments

Comments
 (0)