Explain the difference between microtask and macrotask queues

WHAT IT TESTS: Your event loop mental model and starvation hazards. ANSWER OUTLINE: Macrotasks like setTimeout run one per tick; microtasks like Promises drain fully after each task before rendering.
WHAT IT TESTS: Whether you understand the browser event loop as a scheduling system rather than just a FIFO queue. ANSWER OUTLINE: First, define macrotasks such as setTimeout callbacks and UI events as executing one per loop iteration; second, define microtasks such as Promise handlers as running immediately after the current task clears the stack until the microtask queue is empty; third, note that rendering happens only after microtasks finish.
Read the original → developer.mozilla.org
- #event loop
- #browser
- #javascript
- #microtasks
- #macrotasks
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.