Standard built-ins

WeakRef.prototype.deref()

Try the free JavaScript compiler

Return target if available, otherwise undefined. Keep the returned value strongly referenced while using it; no guarantee across jobs.

Formal Syntax & Structure

javascript syntaxjavascript
weakRef.deref()

Return Value

Object | Symbol | undefined

Available target or undefined.

Working Example

Example Snippetjavascript
const x={n:3};const r=new WeakRef(x);console.log(r.deref().n);
JavaScript Reference