Baseline Widely available
The Map()
constructor creates Map
objects.
new Map()
new Map(iterable)
Note: Map()
can only be constructed with new
. Attempting to call it without new
throws a TypeError
.
iterable
Optional
An Array
or other iterable object whose elements are key-value pairs. (For example, arrays with two elements, such as [[ 1, 'one' ],[ 2, 'two' ]]
.) Each key-value pair is added to the new Map
.
const myMap = new Map([
[1, "one"],
[2, "two"],
[3, "three"],
]);
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4