What are microtasks and macrotasks in the Node.js event loop?

Mid NodeJS

Answer

Microtasks include promise callbacks and queueMicrotask. Macrotasks include timers, I/O callbacks, and setImmediate. Microtasks run before macrotasks within each event loop cycle.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice