Tests whether this object has the specified property as a direct property.
Tests whether this object has the specified property as a direct property.
Unlike js.Object.hasProperty, this method does not check down the object's prototype chain.
MDN
Tests whether this object is in the prototype chain of another object.
Tests whether this object is in the prototype chain of another object.
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.
If the object does not have the specified property, this method returns false.
MDN
The register
method registers an object with a FinalizationRegistry instance so that if
the object is garbage-collected, the registry's callback may get called.
The register
method registers an object with a FinalizationRegistry instance so that if
the object is garbage-collected, the registry's callback may get called.
The target object to register.
The value to pass to the finalizer for this object. This cannot be the target object.
The register
method registers an object with a FinalizationRegistry instance so that if
the object is garbage-collected, the registry's callback may get called.
The register
method registers an object with a FinalizationRegistry instance so that if
the object is garbage-collected, the registry's callback may get called.
The target object to register.
The value to pass to the finalizer for this object. This cannot be the target object.
A token that may be used with the unregister
method later to
unregister the target object. If provided (and not undefined
),
this must be an object. If not provided, the target cannot be unregistered.
The unregister
unregisters a target object from a
FinalizationRegistry instance.
The unregister
unregisters a target object from a
FinalizationRegistry instance.
When a target object has been reclaimed, it is no longer registered in the registry.
There is no need to all unregister
in your cleanup callback. Only call unregister
if
you haven't received a cleanup callback and no longer need to receive one.
The token used with the register method when registering the target object.
ECMAScript 2021
A FinalizationRegistry object lets you request a callback when an object is garbage-collected.
FinalizationRegistry provides a way to request that a cleanup callback get called at some point when an object registered with the registry has been reclaimed (garbage-collected). (Cleanup callbacks are sometimes called finalizers.)
MDN
Type of the target object to register
Type of value to pass to the finalizer
Type of an unregistration token