Event Loop
The event loop is the mechanism that allows a single-threaded runtime, like JavaScript's, to handle asynchronous operations by continuously checking a queue of pending callbacks and executing them one at a time once the current stack of synchronous code has finished running.
8 resources across 2 libraries
Glossary Terms(4)
Multithreading
Multithreading is a programming technique in which a single process runs multiple threads of execution concurrently, allowing different parts of a program to m…
Concurrency
Concurrency is the ability of a program to make progress on multiple tasks during overlapping time periods, whether by truly running them simultaneously or by…
Asynchronous Programming
Asynchronous programming is a programming model that allows a program to start a long-running operation, such as a network request, and continue executing othe…
Event Loop
The event loop is the mechanism that allows a single-threaded runtime, like JavaScript's, to handle asynchronous operations by continuously checking a queue of…
Interview Questions(4)
What Is the JavaScript Event Loop?
The event loop is the mechanism that lets single-threaded JavaScript handle asynchronous work by continuously checking whether the call stack is empty and, if…
Promises vs async/await: What Is the Difference?
Promises and async/await are the same underlying mechanism for handling asynchronous results — async/await is syntactic sugar built on top of Promises that let…
Microtask vs Macrotask Queue: What Is the Difference?
The microtask queue holds high-priority callbacks like Promise .then() handlers and queueMicrotask(), which the event loop fully drains after every single sync…
How Does the Event Loop Order Microtasks and Macrotasks?
After each single macrotask finishes executing, the event loop fully drains the entire microtask queue — including any new microtasks scheduled during that dra…