coderef

queueMicrotask()Baseline · Widely available

The queueMicrotask() method schedules a function to run after the currently running synchronous JavaScript finishes but before returning to the event loop.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 28, 2020. Widely available since Jan 28, 2023.

Browser support

DesktopChrome
1–70Not supported
71+Supportedsince Dec 4, 2018
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–68Not supported
69+Supportedsince Sep 3, 2019
Current: 157
Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27
MobileChrome Android
18–70Not supported
71+Supportedsince Dec 4, 2018
Current: 155
Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157
Safari iOS
1–12Not supported
12.2+Supportedsince Mar 25, 2019
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: queueMicrotask.

Feature detection

JS · check before using
if ("queueMicrotask" in globalThis) {
  // queueMicrotask is available
} else {
  // load a polyfill or use a fallback
}