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 withnew
. Attempting to call it withoutnew
throws aTypeError
.
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.
- : If an iterable object is passed, all of its elements will be added to the new