JavaScript card reviewhard

What is the difference between microtasks and macrotasks?

Microtasks, such as Promise callbacks, are executed before macrotasks like setTimeout callbacks. The event loop processes all microtasks before moving to the next macrotask.

JB

Jeevan Bhargav

Audited by Creator

This answer is calibrated for technical interviews. Verify benchmarks in local sandboxes before deploying.