JS Built-ins
WeakRefbeginner

WeakRef β€” typeof

πŸ“– Usage Example
const target = {}
const ref = new WeakRef(target)
ref.deref() === target  // β†’ true

deref() returns the original target object if it has not been garbage collected.

typeof WeakRef Instance

typeof new WeakRef({}) is 'object'.

Challenge: Verify the type.

πŸ’‘ Hints (1)
  • β€’ All WeakRef instances are objects.