image
MDN Web Docs
In depth: Microtasks and the JavaScript runtime environment - Web APIs | MDN
When debugging or, possibly, when trying to decide upon the best approach to solving a problem around timing and scheduling of tasks and microtasks, there are things about how the JavaScript runtime operates under the hood that may be useful to understand.