FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

Β© 2026 FlareStart. All rights reserved.

Back to articles
Microtask vs Macrotask Explained Simply
NewsWeb Development

Microtask vs Macrotask Explained Simply

via Dev.to JavaScriptShashi Bhushan Kumar1mo ago

Microtask vs Macrotask Explained Simply After understanding the Event Loop, there is one more important concept: πŸ‘‰ Microtask vs Macrotask This is a very common interview question. Let’s understand it in the simplest way possible. First Understand This When asynchronous tasks finish, they don’t directly go to the Call Stack. They go into queues. But there are TWO types of queues: Macrotask Queue Microtask Queue πŸ“¦ What is a Macrotask? Macrotasks are normal async tasks like: setTimeout setInterval setImmediate (Node.js) DOM events Example: setTimeout (() => { console . log ( " Macrotask " ); }, 0 ); setTimeout always goes to the Macrotask Queue . ⚑ What is a Microtask? Microtasks are higher priority tasks like: Promises (.then, .catch) async/await queueMicrotask Example: Promise . resolve (). then (() => { console . log ( " Microtask " ); }); Promises go to the Microtask Queue . πŸƒβ€β™‚οΈ Which Runs First? πŸ‘‰ Microtasks ALWAYS run before Macrotasks. Even if setTimeout has 0 delay. πŸ’» Example con

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
12 views

Related Articles

Qt 6.11 Released
News

Qt 6.11 Released

Lobsters β€’ 1w ago

I Reviewed 1,000 Pull Requests Last Year (These Patterns Emerged)
News

I Reviewed 1,000 Pull Requests Last Year (These Patterns Emerged)

Medium Programming β€’ 1w ago

Barcode generator
News

Barcode generator

Medium Programming β€’ 1w ago

Apple could put ads in Maps as soon as this summer
News

Apple could put ads in Maps as soon as this summer

The Verge β€’ 1w ago

News

### Title: How Do Concrete Vaults Actually Work?

Medium Programming β€’ 1w ago

Discover More Articles