You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/07-map-set/article.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,12 @@ But that's not enough for real life. That's why `Map` and `Set` also exist.
15
15
Methods and properties are:
16
16
17
17
-`new Map()` -- creates the map.
18
-
-`map.set(key, value)` -- stores the value by the key.
19
-
-`map.get(key)` -- returns the value by the key, `undefined` if `key` doesn't exist in map.
20
-
-`map.has(key)` -- returns `true` if the `key` exists, `false` otherwise.
21
-
-`map.delete(key)` -- removes the value by the key.
22
-
-`map.clear()` -- removes everything from the map.
23
-
-`map.size` -- returns the current element count.
18
+
-[`map.set(key, value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set) -- stores the value by the key.
19
+
-[`map.get(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
20
+
-[`map.has(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
21
+
-[`map.delete(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete) -- removes the value by the key.
22
+
-[`map.clear()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear) -- removes everything from the map.
23
+
-[`map.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size) -- returns the current element count.
24
24
25
25
For instance:
26
26
@@ -105,9 +105,9 @@ map.set('1', 'str1')
105
105
106
106
For looping over a `map`, there are 3 methods:
107
107
108
-
- `map.keys()` -- returns an iterable for keys,
109
-
- `map.values()` -- returns an iterable for values,
110
-
- `map.entries()` -- returns an iterable for entries `[key, value]`, it's used by default in `for..of`.
108
+
- [`map.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys) -- returns an iterable for keys,
109
+
- [`map.values()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values) -- returns an iterable for values,
110
+
- [`map.entries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries) -- returns an iterable for entries `[key, value]`, it's used by default in `for..of`.
0 commit comments