Microtask Queue

noun

say it: “MY-kroh-task KYOO” /ˈmaɪkroʊˌtæsk kju/

A line of waiting callbacks, such as a promise's .then() callbacks, that JavaScript runs as soon as the current code finishes, before any timer's callback.

What is Microtask Queue in JavaScript?

Microtask Queue — A high-priority queue used by Promise reactions and queueMicrotask callbacks.

queueMicrotask(() => {
    updateStatus("Ready");
});

In a sentence

  • “The promise's message printed before the timer's because its callback waited in the microtask queue.”
  • “Every callback in the microtask queue runs before the event loop picks up the next timer.”

Level: Master · More JavaScript terms at this level

Updated

In other subjects