Understanding Javascript Promises and Event Loop Concurrency
A visual explanation of microtask queues, macrotask execution, and scheduling async timers.
Javascript executes on a single main thread, yet handles multiple concurrency tasks. This is coordinate by the browser's event loop.
We explain how promises schedule tasks inside microtask queues, why they block timeouts, and strategies to prevent main thread blocking.