Weak references
Widely available
The WeakRef
and FinalizationRegistry
objects hold references to garbage-collectable objects without creating strong references that prevent their garbage collection.
To learn more, see
WeakRef,
FinalizationRegistry at MDN.
Compatibility
- Chrome 84 Released on 2020-07-27
- Chrome Android 84 Released on 2020-07-27
- Edge 84 Released on 2020-07-16
- Firefox 79 Released on 2020-07-28
- Firefox for Android 79 Released on 2020-07-28
- Safari 14.1 Released on 2021-04-26
- Safari on iOS 14.5 Released on 2021-04-26
Specifications
- ECMAScript Language Specification (#sec-managing-memory), from TC39 (Ecma International).