Using microtasks in JavaScript with queueMicrotask()
CRANK

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

developer.mozilla.org
Related Topics: JavaScript