[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/WeakSet [Back]  [Original]

WeakSet() - JavaScript | MDN

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

View in English Always switch to English

WeakSet()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 9.

WeakSet() WeakSet .

In this article

js
new WeakSet()
new WeakSet(iterable)

: WeakSet() new . new TypeError .

iterable Optional

, WeakSet . null undefined .

WeakSet

js
const ws = new WeakSet();
const foo = {};
const bar = {};

ws.add(foo);
ws.add(bar);

ws.has(foo); // true
ws.has(bar); // true

ws.delete(foo); // foo  set 
ws.has(foo); // false, foo  
ws.has(bar); // true, bar  

foo !== bar . . set .

Specification
ECMAScript 2027 LanguageSpecification
# sec-weakset-constructor


Web Proxy Viewer  |  New URL  |  Original Page