The Event Loop

How JavaScript runs asynchronous code on a single thread: the call stack runs to completion, then microtasks (promises) drain, then the browser may render, then the next macrotask (timers, events) runs.

Loading NamasteScale