The single-threaded execution model means JavaScript runs one piece of code at a time. In a browser, event handlers share that one-at-a-time execution path. section 1.1 section 4.3.1
For browser events:
- The browser places detected events in a queue in detection order, then processes the event at the head. section 4.3.1
- While one handler runs, other events wait. A long-running handler can make a web application unresponsive. section 4.3.1
One teller window
Imagine a bank line with only one teller window: customers (events) wait their turn while one is being served. Likewise, a slow handler holds up events behind it. section 4.3.1
Figure 4.6 In the event-handling phase, all events (whether coming from the user, such as mouse clicks and key presses, or coming from the server, such as fetch events) are queued up as they occur and are processed as the single thread of execution allows.
The figure shows user events and server events entering a queue and being processed by the single thread. section 4.3.1


