The FinalizationRegistry
constructor creates a FinalizationRegistry
object that uses the given callback.
Syntax
new FinalizationRegistry([callback]);
Parameters
callback
Optional- The callback function this registry should use. If provided, this must be a function.
Examples
Creating a new registry
You create the registry passing in the callback:
const registry = new FinalizationRegistry(heldValue => { // .... });
Specifications
Specification |
---|
WeakRefs The definition of 'FinalizationRegistry constructor' in that specification. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FinalizationRegistry() constructor | Chrome Full support 84 | Edge Full support 84 | Firefox Full support 79 | IE No support No | Opera No support No | Safari No support No | WebView Android Full support 84 | Chrome Android Full support 84 | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No | nodejs
Full support
13.0.0
|
Legend
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- User must explicitly enable this feature.