What happens to the WeakMap entry after setting obj to null?
const weakMap = new WeakMap();
let obj = { data: 'some data' };
weakMap.set(obj, 'metadata');
obj = null;
When obj is set to null: 1) The object previously referenced by obj becomes eligible for garbage collection, 2) The WeakMap entry will be removed during the next garbage collection cycle, 3) This removal happens automatically without any explicit cleanup code, 4) The timing of the actual removal depends on the JavaScript engine's garbage collector, 5) This automatic cleanup is a key feature that prevents memory leaks, 6) You cannot observe when the cleanup occurs as WeakMap doesn't provide enumeration methods, 7) This behavior makes WeakMap ideal for caching and resource management scenarios, 8) It demonstrates how WeakMap automatically handles cleanup of unreferenced objects.