| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Map/Map | [Back] [Original] |
Get to know MDN better
Esta pgina ha sido traducida del ingls por la comunidad. Aprende ms y nete a la comunidad de MDN Web Docs.
This feature is well established and works across many devices and browser versions. Its been available across browsers since julio de 2015.
El constructor Map() crea objetos de tipo Map.
new Map()
new Map(iterable)
Nota:
Map() slo puede ser construido con la palabra clave new. Intentar llamaro sin la palabra clave new arroja un TypeError.
iterable OpcionalUn objeto Array u otro objeto
iterable cuyos elementos sean tuplas llave-valor. (Por ejemplo, arreglos con dos elementos,
tales como [[ 1, 'one' ],[ 2, 'two' ]].) Cada tupla llave-valor es agregada al nuevo objeto Map.
const myMap = new Map([
[1, "one"],
[2, "two"],
[3, "three"],
]);
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-map-constructor |
This page was last modified on 21 jul 2025 by MDN contributors.
MapObject/FunctionYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |