Weak Map
Noun · Development
Definitions
A key-value collection (in JavaScript and similar languages) where keys must be objects and are held via weak references, meaning entries are automatically garbage-collected when no other references to the key exist — useful for associating metadata with objects without preventing their cleanup.
In plain English: A special dictionary where entries disappear automatically when nothing else in the program is using the key anymore.
Example: "We use a WeakMap to cache computed layouts keyed by DOM nodes — when a node is removed from the DOM, its cache entry gets GC'd automatically."