The WeakMap object is a collection of key/value pairs in which the keys are weakly referenced. The keys must be objects and the values can be arbitrary values. Similar to Map but differs in that WeakMaps only take objects as keys, they don’t have a size, are not enumerable (can’t loop over), have no clear() method, and if items no longer exist anywhere else in your application then they will be garbage collected.

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