Skip to content

Commit af4843b

Browse files
authored
👾 smth
1 parent 18b1314 commit af4843b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ But that's not enough for real life. That's why `Map` and `Set` also exist.
1414

1515
Methods and properties are:
1616

17-
- `new Map()` -- creates the map.
17+
- [`new Map()`](mdn:js/Map/Map) -- creates the map.
1818
- [`map.set(key, value)`](mdn:js/Map/set) -- stores the value by the key.
1919
- [`map.get(key)`](mdn:js/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
2020
- [`map.has(key)`](mdn:js/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
@@ -100,7 +100,6 @@ map.set('1', 'str1')
100100
```
101101
````
102102
103-
104103
## Iteration over Map
105104
106105
For looping over a `map`, there are 3 methods:
@@ -233,11 +232,11 @@ That's the same, because `Object.fromEntries` expects an iterable object as the
233232
234233
## Set
235234
236-
A `Set` is a special type collection - "set of values" (without keys), where each value may occur only once.
235+
A [`Set`](mdn:js/Set) is a special type collection - "set of values" (without keys), where each value may occur only once.
237236
238237
Its main methods are:
239238
240-
- `new Set(iterable)` -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
239+
- [`new Set(iterable)`](mdn:js/Set/Set) -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
241240
- [`set.add(value)`](mdn:js/Set/add) -- adds a value, returns the set itself.
242241
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
243242
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
@@ -301,11 +300,11 @@ The same methods `Map` has for iterators are also supported:
301300
302301
## Summary
303302
304-
`Map` -- is a collection of keyed values.
303+
[Map](mdn:js/Map) -- is a collection of keyed values.
305304
306305
Methods and properties:
307306
308-
- `new Map([iterable])` -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization.
307+
- [`new Map([iterable])`](mdn:js/Map/Map) -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization.
309308
- [`map.set(key, value)`](mdn:js/Map/set) -- stores the value by the key, returns the map itself.
310309
- [`map.get(key)`](mdn:js/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
311310
- [`map.has(key)`](mdn:js/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
@@ -318,11 +317,11 @@ The differences from a regular `Object`:
318317
- Any keys, objects can be keys.
319318
- Additional convenient methods, the `size` property.
320319
321-
`Set` -- is a collection of unique values.
320+
[`Set`](mdn:js/Set) -- is a collection of unique values.
322321
323322
Methods and properties:
324323
325-
- `new Set([iterable])` -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
324+
- [`new Set(iterable)`](mdn:js/Set/Set) -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
326325
- [`set.add(value)`](mdn:js/Set/add) -- adds a value (does nothing if `value` exists), returns the set itself.
327326
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
328327
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.

0 commit comments

Comments
 (0)