Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The Map() constructor creates Map objects.
If an iterable object (such as an array) is passed, all of its elements will be added to the new Map. Each element must be an object with two properties: 0 and 1, which correspond to the key and value (for example, [[1, "one"],[2, "two"]]). If you don't specify this parameter, or its value is null or undefined, the new Map is empty.
| ECMAScript® 2027 Language Specification # sec-map-constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Sep 13, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.