aboutsummaryrefslogtreecommitdiff
path: root/files/ko/conflicting/web/javascript/reference/global_objects/map/index.html
blob: 3445bf2847be49430c517bb130d9c11e013acc2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
title: Map.prototype
slug: Web/JavaScript/Reference/Global_Objects/Map/prototype
tags:
  - ECMAScript 2015
  - JavaScript
  - Map
  - Property
  - Reference
translation_of: Web/JavaScript/Reference/Global_Objects/Map
translation_of_original: Web/JavaScript/Reference/Global_Objects/Map/prototype
---
<div>{{JSRef}}</div>

<p><code><strong>Map</strong></code><strong><code>.prototype</code></strong> property는 {{jsxref("Map")}}의 프로토 타입을 나타낸다.</p>

<div>{{js_property_attributes(0,0,0)}}</div>

<h2 id="Description">Description</h2>

<p>{{jsxref("Map")}} instance는 {{jsxref("Map.prototype")}}를 상속한다. Constructor의 프로토타입에 property와 method를 추가함으로써 모든 <code>Map</code> 인스턴스에서 사용 가능하게끔 만들 수 있다.</p>

<h2 id="Properties">Properties</h2>

<dl>
 <dt><code>Map.prototype.constructor</code></dt>
 <dd>인스턴스의 프로토타입을 만드는 함수를 반환한다. 이것 {{jsxref("Map")}} 함수의 기본 값이다.</dd>
 <dt>{{jsxref("Map.prototype.size")}}</dt>
 <dd><code>Map</code> 객체에 들어있는 key/value pair의 수를 반환한다.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<dl>
 <dt>{{jsxref("Map.prototype.clear()")}}</dt>
 <dd><code>Map</code> 객체의 모든 key/value pair를 제거한다.</dd>
 <dt>{{jsxref("Map.delete", "Map.prototype.delete(key)")}}</dt>
 <dd>주어진 키(Key)와 해당되는 값(Value)를 제거하고 제거하기 전에 <code>Map.prototype.has(key)가 반환했던 값을 반환한다.</code> 그 후의 <code>Map.prototype.has(key)<font face="Open Sans, arial, sans-serif">는 </font></code><code>false를 반환한다.</code></dd>
 <dt>{{jsxref("Map.prototype.entries()")}}</dt>
 <dd><code>Map</code> 객체 안의 모든 요소들을 <strong><code>[key, value] 형태의 </code>array </strong>로 집어넣은 순서대로 가지고 있는 <code>Iterator 객체를 반환한다.</code></dd>
 <dt>{{jsxref("Map.forEach", "Map.prototype.forEach(callbackFn[, thisArg])")}}</dt>
 <dd><code>Map</code> 객체 안에 존재하는 각각의 key/value pair에 집어넣은 순서대로 callbackFn을 부른다. 만약 thisArg 매개변수가 제공되면, 이것이 각 callback의 this 값으로 사용된다.</dd>
 <dt>{{jsxref("Map.get", "Map.prototype.get(key)")}}</dt>
 <dd>주어진 키(Key)에 해당되는 값(value)을 반환하고, 만약 없으면 <code>undefined를 반환한다.</code></dd>
 <dt>{{jsxref("Map.has", "Map.prototype.has(key)")}}</dt>
 <dd><code>Map 객체 안에 주어진 </code>key/value pair가 있는지 검사하고 Boolean 값을 반환한다.</dd>
 <dt>{{jsxref("Map.prototype.keys()")}}</dt>
 <dd><code>Map</code> 객체 안의 모든 <strong>키(Key)</strong>들을 집어넣은 순서대로 가지고 있는 <code>Iterator 객체를 반환한다.</code></dd>
 <dt>{{jsxref("Map.set", "Map.prototype.set(key, value)")}}</dt>
 <dd><code>Map 객체에 주어진 키</code>(Key)에 값(Value)를 집어넣고, <code>Map 객체를 반환한다.</code></dd>
 <dt>{{jsxref("Map.prototype.values()")}}</dt>
 <dd><code>Map</code> 객체 안의 모든 <strong></strong><strong>(Value)</strong>들을 집어넣은 순서대로 가지고 있는 <code>Iterator 객체를 반환한다.</code></dd>
 <dt>{{jsxref("Map.@@iterator", "Map.prototype[@@iterator]()")}}</dt>
 <dd><code>Map</code> 객체 안의 모든 요소들을 <strong><code>[key, value] 형태의 </code>array </strong>로 집어넣은 순서대로 가지고 있는 <code>Iterator 객체를 반환한다.</code></dd>
</dl>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('ES2015', '#sec-map.prototype', 'Map.prototype')}}</td>
   <td>{{Spec2('ES2015')}}</td>
   <td>Initial definition.</td>
  </tr>
  <tr>
   <td>{{SpecName('ESDraft', '#sec-map.prototype', 'Map.prototype')}}</td>
   <td>{{Spec2('ESDraft')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("javascript.builtins.Map.prototype")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{jsxref("Set.prototype")}}</li>
</ul>