Skip to content

Event Loop

The event loop is the mechanism that allows JavaScript to perform non-blocking operations despite being single-threaded.

  • Understand the event loop’s role in JavaScript
  • Know the order of execution for sync and async code
  • Understand microtasks vs macrotasks priority

Event loop enables async concurrency in single-threaded JS. Microtasks run before macrotasks. The event loop pauses when the call stack is not empty.