Standard built-ins
WeakRef
Create weak access to an eligible target; does not establish a collection deadline. Do not depend on weak access for critical cleanup.
Formal Syntax & Structure
javascript syntaxjavascript
new WeakRef(target)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| target | Object | nonregistered Symbol | Eligible target. |
Return Value
WeakRef
New weak reference.
Working Example
Example Snippetjavascript
const x={};console.log(new WeakRef(x).deref()===x);