Skip to main content
Version: 3.7.0


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


new WeakSet()
new WeakSet(iterable)

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


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