Standard Maps keep a ‘strong’ reference to keys, preventing Garbage Collection even if the object is no longer used. This causes memory leaks in long-running SPAs.
// The Safe Way
let userMetadata = new WeakMap();
let user = { id: 1 };
userMetadata.set(user, { lastLogin: Date.now() });
user = null; // The metadata is now eligible for GC automatically!
