derefbeginnerconst cache = new WeakRef(computeExpensiveResult())
const result = cache.deref() ?? recompute()Use deref() with nullish coalescing to fall back to recomputation if the object was GC'd.
You can hold a weak reference to an array. deref() returns the same array.
Challenge: Verify deref on an array WeakRef.