Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.03 KB

File metadata and controls

53 lines (36 loc) · 1.03 KB

API Reference

Table of contents

WeakSet

Constructor

from(mapEntries)

Creates a WeakSet object that contains all keys mapEntries and each key must be an object.

const key1 = {};
const key2 = {};
const entries = [key1, key2];
const m = WeakSet.from(entries);

m.has(key1); // true
m.has(key2); // true

isWeakSet(x)

Returns true if x is a WeakSet object.

WeakSet.isWeakSet(new WeakSet()) === true;

of(element0[, element1[, ...[, elementN]]])

Creates a new WeakSet object from a variable number of arguments, regardless of the number of type of the arguments.

const key1 = {};
const key2 = {};
const m = WeakSet.of(key1, key2);

m.has(key1); // true;
m.has(key2); // true;

Prototype

None