Skip to main content
Version: 1.2.0

WeakSet

The WeakSet constructor lets you create WeakSet objects that store weakly held objects in a collection.

Syntax

new WeakSet()
new WeakSet(iterable)

Note: WeakSet() can only be constructed with new. Attempting to call it without new throws a TypeError.

Parameters

  • iterable optional
    • : If an iterable object is passed, all of its elements will be added to the new WeakSet. null is treated as undefined.