Skip to content

Commit 11eef4c

Browse files
authored
👾 add mdn links to Map and Set methods
1 parent 53b35c1 commit 11eef4c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

‎1-js/05-data-types/07-map-set/article.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ But that's not enough for real life. That's why `Map` and `Set` also exist.
1515
Methods and properties are:
1616

1717
- `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.
2424

2525
For instance:
2626

@@ -105,9 +105,9 @@ map.set('1', 'str1')
105105
106106
For looping over a `map`, there are 3 methods:
107107
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`.
111111
112112
For instance:
113113

0 commit comments

Comments
 (0)