Skip to main content
Version: Next

queueMicrotask

function queueMicrotask(callback): void;

A microtask is a short function which is executed after the function or module which created it exits and only if the JavaScript execution stack is empty, but before returning control to the event loop being used to drive the script's execution environment.

Parameters

ParameterTypeDescription

callback

() => void

A function to be executed.

Returns

void

Throws

Throws TypeError if callback is not a function.