Merge pull request #2192 from vsemozhetbyt/patch-3

Symmetrize Map and Set summaries
This commit is contained in:
Ilya Kantor 2020-11-24 23:25:32 +03:00 committed by GitHub
commit aacdf015c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -304,10 +304,10 @@ The same methods `Map` has for iterators are also supported:
Methods and properties: Methods and properties:
- `new Map([iterable])` -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization. - `new Map([iterable])` -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization.
- `map.set(key, value)` -- stores the value by the key. - `map.set(key, value)` -- stores the value by the key, returns the map itself.
- `map.get(key)` -- returns the value by the key, `undefined` if `key` doesn't exist in map. - `map.get(key)` -- returns the value by the key, `undefined` if `key` doesn't exist in map.
- `map.has(key)` -- returns `true` if the `key` exists, `false` otherwise. - `map.has(key)` -- returns `true` if the `key` exists, `false` otherwise.
- `map.delete(key)` -- removes the value by the key. - `map.delete(key)` -- removes the value by the key, returns `true` if `key` existed at the moment of the call, otherwise `false`.
- `map.clear()` -- removes everything from the map. - `map.clear()` -- removes everything from the map.
- `map.size` -- returns the current element count. - `map.size` -- returns the current element count.