JavaScript WeakMap, WeakSet, and WeakRef: When Regular Maps Hold On Forever
WeakMap, WeakSet, and WeakRef let you reference objects without keeping them alive. Restrictions, use cases (DOM annotation, private fields, soft caches, cycle detection), why iteration is forbidden, and why the spec says to use WeakRef sparingly.
JavaScript WeakMap, WeakSet, and WeakRef: When Regular Maps Hold On Forever Read More »

