WeakMap is a javascript map where keys can be anything, including JS objects. Contrast this to other maps where keys must be primitives. In addition, since the map is "weak", keys are only weakly referenced. In other words, once there are no more references to a key, that key is garbage collected and removed from the WeakMap.
Note that WeakMaps do not allow for iteration, and only have a basic "get" method to retrieve info on keys
WeakMap is a javascript map where keys can be anything, including JS objects. Contrast this to other maps where keys must be primitives. In addition, since the map is "weak", keys are only weakly referenced. In other words, once there are no more references to a key, that key is garbage collected and removed from the WeakMap.
Note that WeakMaps do not allow for iteration, and only have a basic "get" method to retrieve info on keys
Sometimes used to help with encapsulation