What is the event loop?
Answer out loud or in your head first, then compare.
Answer
It's the mechanism that lets JavaScript handle tasks when it's ready to run them. First the currently running code finishes. When the result of an asynchronous operation is available, the right function can run, following the rules of the queues and the environment.
Example: a server sends a query to the database. Instead of blocking JavaScript execution for the whole wait, it can handle other requests. When the database answers, it goes back to working with the result. That doesn't mean two ordinary JS functions run at the same time on the same thread. A long computational loop can still stop everything.
Why it matters: Without it, Promises, async/await and Node performance are hard to understand.
Possible follow-ups: Why can a long for loop delay the response to another request?
How did it go? Be honest — “Not yet” puts the question on your review list.
Related questions
- What do you understand about event loop? — JavaScript
- The event loop in Node.js — Node.js
Further reading
- Node.js: The Event Loop(opens in a new tab)Docs; accessed 22.10.2026. Event loop phases, timers and differences between Node/libuv versions.