The JavaScript event loop coordinates synchronous code, microtasks, and macrotasks so one thread can handle many async workflows without blocking UI updates.
JavaScript in the browser runs on a single call stack for regular code execution. When async work is scheduled, JavaScript delegates that work to browser or runtime APIs and keeps executing other code.
The event loop continuously checks whether the call stack is empty. If it is empty, it first flushes the microtask queue, then takes the next macrotask, and repeats this cycle.
This model is why JavaScript can feel concurrent even though most user code is single-threaded. Understanding queue priority explains why Promise callbacks can run before setTimeout callbacks.
Interview framing: define Event Loop in one sentence, then explain one concrete runtime behavior and one common pitfall with a short code example.