concept WeakSet in category javascript

appears as: WeakSet, A WeakSet
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond

This is an excerpt from Manning's book Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond.

24.3. What about the WeakSet?

A WeakSet is a specialized type of Set. Its sole purpose is to contain objects weakly in the sense that it doesn’t prevent them from being garbage-collected. Normally if you add an object to an array and remove all other references to it, it will still not be eligible for garbage collection because the array still has a reference to the object. This is the same for sets as well. Sometimes you may want to store an object without preventing it from being garbage-collected, though.