coderef

Garbage collection (WebAssembly)Baseline · Newly available

Garbage collection tracks references for better memory management with garbage-collected languages running in WebAssmbly.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Dec 11, 2024.

Browser support

DesktopChrome
1–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155
Edge
12–118Not supported
119+Supportedsince Nov 2, 2023
Current: 154
Firefox
1–119Not supported
120+Supportedsince Nov 21, 2023
Current: 157
Safari
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27
MobileChrome Android
18–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155
Firefox Android
4–119Not supported
120+Supportedsince Nov 21, 2023
Current: 157
Safari iOS
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Dec 11, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN — see the links below.

Feature detection

There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.