JS Built-ins
WeakRefbeginner

WeakRef β€” deref preserves properties

πŸ“– Usage Example
const obj = { name: 'test' }
const ref = new WeakRef(obj)
obj.name  // β†’ 'test'

Holding a WeakRef does not keep the object alive on its own.

WeakRef Property Access

new WeakRef({x: 1}).deref().x === 1.

Challenge: Verify property access through deref.

πŸ’‘ Hints (1)
  • β€’ The dereferenced object has all original properties intact.