Movatterモバイル変換


[0]ホーム

URL:


  1. 개발자를 위한 웹 기술
  2. JavaScript
  3. JavaScript 참고서
  4. 표준 내장 객체
  5. Map
  6. Map() 생성자

This page was translated from English by the community.Learn more and join the MDN Web Docs community.

View in EnglishAlways switch to English

Map() 생성자

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015년 7월⁩.

Map() 생성자는Map 객체를 생성합니다.

구문

js
new Map()new Map(iterable)

참고 :Map()은 오직new로만 생성할 수 있습니다.new 없이 호출하면TypeError가 발생합니다.

매개변수

iterableOptional

하나의Array 혹은 키-값 쌍인 요소를 가진반복 가능 객체. (예를 들어[[ 1, 'one' ],[ 2, 'two' ]]과 같이 2개의 요소를 가진 배열). 각각의 키-값 쌍은 새로운Map에추가됩니다.

예제

새로운 Map 생성하기

js
const myMap = new Map([  [1, "one"],  [2, "two"],  [3, "three"],]);

명세서

Specification
ECMAScript® 2026 Language Specification
# sec-map-constructor

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp