JavaScript Tutorial ✦
Weak References
References that don't prevent garbage collection of the referenced object.
const { WeakRef } = require('weak-ref');
const obj = {};
const weakRef = new WeakRef(obj);
obj = null; // Eligible for GC
console.log(weakRef.deref()); // undefined