aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/weakset
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/weakset')
-rw-r--r--files/ko/web/javascript/reference/global_objects/weakset/index.html108
-rw-r--r--files/ko/web/javascript/reference/global_objects/weakset/prototype/index.html141
2 files changed, 249 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/weakset/index.html b/files/ko/web/javascript/reference/global_objects/weakset/index.html
new file mode 100644
index 0000000000..17f818659d
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/weakset/index.html
@@ -0,0 +1,108 @@
+---
+title: WeakSet
+slug: Web/JavaScript/Reference/Global_Objects/WeakSet
+tags:
+ - ECMAScript 2015
+ - JavaScript
+ - Reference
+ - WeakSet
+translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>WeakSet</code></strong> 객체는 약하게 유지되는(held, 잡아두는) <em>객체</em>를 컬렉션에 저장할 수 있습니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">new WeakSet([iterable]);</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>iterable</code></dt>
+ <dd><a href="/ko/docs/Web/JavaScript/Reference/Statements/for...of">iterable 객체</a>가 전달된 경우, 모든 객체 요소는 새로운 <code>WeakSet</code>에 추가됩니다. null은 undefined로 취급됩니다.</dd>
+</dl>
+
+<h2 id="설명">설명</h2>
+
+<p><code>WeakSet</code> 객체는 객체 컬렉션입니다. <code>WeakSet</code> 내 객체는 오직 한 번만 발생할 수 있습니다. 즉, <code>WeakSet</code> 컬렉션 내에서 유일합니다.</p>
+
+<p>{{jsxref("Set")}} 객체와 주된 차이는 다음과 같습니다:</p>
+
+<ul>
+ <li><code>Set</code>과 달리, <code>WeakSet</code>은 <strong>객체 만의 컬렉션</strong>이며 모든 유형의 임의 값(의 컬렉션)은 아닙니다.</li>
+ <li><code>WeakSet</code>은 약합니다(<em>weak</em>): 컬렉션 내 객체 참조는 약하게 유지됩니다. <code>WeakSet</code> 내 저장된 객체에 다른 참조가 없는 경우, 쓰레기 수집(garbage collection)될 수 있습니다. 이는 또한 컬렉션 내 현재 저장된 객체 목록이 없음을 뜻합니다. <code>WeakSets</code>은 열거불가입니다.</li>
+</ul>
+
+<h2 id="속성">속성</h2>
+
+<dl>
+ <dt><code>WeakSet.length</code></dt>
+ <dd><code>length</code> 속성값은 0.</dd>
+ <dt>{{jsxref("WeakSet.prototype")}}</dt>
+ <dd><code>Set</code> 생성자에 대한 프로토타입을 나타냅니다. 모든 <code>WeakSet</code> 객체에 속성을 추가할 수 있습니다.</dd>
+</dl>
+
+<h2 id="WeakSet_인스턴스"><code>WeakSet</code> 인스턴스</h2>
+
+<p>모든 <code>WeakSet</code> 인스턴스는 {{jsxref("WeakSet.prototype")}}에서 상속합니다.</p>
+
+<h3 id="속성_2">속성</h3>
+
+<p>{{page('ko/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/prototype','속성')}}</p>
+
+<h3 id="메서드">메서드</h3>
+
+<p>{{page('ko/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/prototype','메서드')}}</p>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="WeakSet_객체_사용"><code>WeakSet</code> 객체 사용</h3>
+
+<pre class="brush: js">var ws = new WeakSet();
+var obj = {};
+var foo = {};
+
+ws.add(window);
+ws.add(obj);
+
+ws.has(window); // true
+ws.has(foo); // false, foo가 집합에 추가되지 않았음
+
+ws.delete(window); // 집합에서 window 제거함
+ws.has(window); // false, window가 제거되었음
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">명세</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-weakset-objects', 'WeakSet')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td>초기 정의.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-weakset-objects', 'WeakSet')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("javascript.builtins.WeakSet")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Map")}}</li>
+ <li>{{jsxref("Set")}}</li>
+ <li>{{jsxref("WeakMap")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/global_objects/weakset/prototype/index.html b/files/ko/web/javascript/reference/global_objects/weakset/prototype/index.html
new file mode 100644
index 0000000000..ee3f439ae9
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/weakset/prototype/index.html
@@ -0,0 +1,141 @@
+---
+title: WeakSet.prototype
+slug: Web/JavaScript/Reference/Global_Objects/WeakSet/prototype
+tags:
+ - ECMAScript6
+ - JavaScript
+ - Property
+ - WeakSet
+translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet
+---
+<div>{{JSRef}}</div>
+
+<p><code><strong>WeakSet.prototype</strong></code> 속성(property)은 {{jsxref("WeakSet")}} 생성자에 대한 프로토타입을 나타냅니다.</p>
+
+<div>{{js_property_attributes(0,0,0)}}</div>
+
+<h2 id="설명">설명</h2>
+
+<p>{{jsxref("WeakSet")}} 인스턴스는 {{jsxref("WeakSet.prototype")}}에서 상속합니다. 모든 <code>WeakSet</code> 인스턴스에 속성 또는 메서드를 추가하기 위해 생성자의 프로토타입 객체를 사용할 수 있습니다.</p>
+
+<p><code>WeakSet.prototype</code>은 그 자체로 그냥 평범한 객체입니다:</p>
+
+<pre class="brush: js">Object.prototype.toString.call(WeakSet.prototype); // "[object Object]"</pre>
+
+<h2 id="속성">속성</h2>
+
+<dl>
+ <dt><code>WeakSet.prototype.constructor</code></dt>
+ <dd>인스턴스의 프로토타입을 생성한 함수를 반환합니다. 이는 기본으로 {{jsxref("WeakSet")}} 함수입니다.</dd>
+</dl>
+
+<h2 id="메서드">메서드</h2>
+
+<dl>
+ <dt>{{jsxref("WeakSet.add", "WeakSet.prototype.add(value)")}}</dt>
+ <dd><code>WeakSet</code> 객체에 주어진 값을 갖는 새로운 객체를 추가합니다.</dd>
+ <dt>{{jsxref("WeakSet.delete", "WeakSet.prototype.delete(value)")}}</dt>
+ <dd><code>value</code>와 관련된 요소를 제거합니다. <code>WeakSet.prototype.has(value)</code>는 그 뒤에 <code>false</code>를 반환합니다.</dd>
+ <dt>{{jsxref("WeakSet.has", "WeakSet.prototype.has(value)")}}</dt>
+ <dd><code>WeakSet</code> 객체 내 주어진 값을 갖는 요소가 존재하는 지 여부를 주장하는(asserting, 나타내는) boolean을 반환합니다.</dd>
+ <dt><s class="obsoleteElement">{{jsxref("WeakSet.prototype.clear()")}} {{obsolete_inline}}</s></dt>
+ <dd><s class="obsoleteElement"><code>WeakSet</code> 객체에서 모든 요소를 제거합니다.</s></dd>
+</dl>
+
+<h2 id="스펙">스펙</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">스펙</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-weakset.prototype', 'WeakSet.prototype')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>초기 정의.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-weakset.prototype', 'WeakSet.prototype')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>36</td>
+ <td>{{ CompatGeckoDesktop(34) }}</td>
+ <td>{{CompatNo}}</td>
+ <td>23</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td>Ordinary object</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop("40")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome for Android</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{ CompatGeckoMobile(34) }}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td>Ordinary object</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile("40")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li>{{jsxref("Set.prototype")}}</li>
+ <li>{{jsxref("WeakMap.prototype")}}</li>
+</ul>