WeakRef
The WeakRef
constructor creates a WeakRef
object referring to a given target object.
Syntax
new WeakRef(targetObject)
Note:
WeakRef()
can only be constructed withnew
. Attempting to call it withoutnew
throws aTypeError
.
Parameters
targetObject
- : The target object the WeakRef should refer to (also called the referent).