Question 4 of 10Pro Only
Explain the difference between microtasks and macrotasks in the JavaScript Event Loop. In what order do they execute?
Sample answer preview
The Event Loop manages asynchronous code execution in JavaScript. It uses two types of queues with different priorities: microtasks and macrotasks. Macrotasks, also called tasks, include setTimeout, setInterval, setImmediate in Node.js, DOM events, and requestAnimationFrame…
event loopmicrotaskmacrotaskPromisesetTimeoutqueueMicrotask