The WeakSet object lets you store weakly held objects in a collection. In contrast to Sets, WeakSets can only ever contain an array of objects, cannot be looped over (no iterator), and has no clear() method allowing for automatic garbage collection (item is removed from WeakSet when deleted).

See the Pen thecodelog.com - ES6 WeakSet 2 by Deano (@deangilewicz) on CodePen.