Javascript MicroTask vs MacroTask Queue - Visually Explained Through An Animation 🀯πŸ”₯

Ram Maheshwari ♾️ - Jan 24 '23 - - Dev Community

Microtask vs Macrotask Queue in JavaScript

I created this above animation to help you understand the difference between MicroTask & MacroTask Queue in JavaScript 🀯πŸ”₯

Took me almost 5-6 hrs to create this for you guys ✌️

Now, let's understand the difference between MicroTask Queue & MacroTask Queue in JavaScript πŸ¦„

Microtask Queue: ⬇️

In JavaScript, a microtask queue is a queue of tasks that are executed after the current task (i.e., the task currently being executed by the JavaScript engine) completes. These tasks include things like resolving Promises and updating the DOM βœ…

Macrotask Queue: ⬇️

A microtask queue, on the other hand, is a queue of tasks that are executed after all microtasks have been processed. These tasks include things like setTimeout and setInterval. The JavaScript engine processes the tasks in the microtask queue before moving on to the tasks in the macrotask queue βœ…

Hope this is helpful ✨

Do Like ❀️ & Save πŸ”–

π—™π—Όπ—Ήπ—Ήπ—Όπ˜„ me on Linkedin for more:
TipsπŸ’‘+ GuidesπŸ“œ + Resources ⚑ related to programming and Web Development πŸ‘¨β€πŸ’»

Do Follow me here on dev.to βœ…

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player