WeakSet
References to keys/values held weakly
Do not prevent garbage collection
Small api ( add, delete, check for values ) compared to set/map
cann't be iterated
Note
keys must be objects
the values can be arbitrary values.
No clear() method on weakset
As if their is no reference to object wekset runs garbage collection so we have no need to worry about it
WeakSet Demo
Last updated
Was this helpful?