A WeakMap is a collection of key/value pairs whose keys must be Objects or non-registered symbols, with values of any arbitrary JavaScript type, and which does not create strong references to its keys. That is, an Object's presence as a key in a WeakMap does not prevent the Object from being garbage collected. Once an Object used as a key has been collected, its corresponding values in any WeakMap become candidates for garbage collection as well — as long as they aren't strongly referred to elsewhere. The only primitive type that can be used as a WeakMap key is symbol — more specifically, non-registered symbols — because non-registered symbols are guaranteed to be unique and cannot be re-created....handleObjectValues(obj) { if (cache.has(obj)) { return cache.get(obj); } const...Object.values(obj).map(heavyComputation); cache.set(obj, result);...