KGKailash Gayariinexecution-context-and-call-stack.hashnode.dev路Jan 29, 2025 路 2 min readJavaScript Macro and Micro Task Execution ExplanationJavaScript has a single-threaded event loop, meaning it processes one task at a time. However, within this loop, tasks are divided into macro-tasks and micro-tasks, which determine the execution order. 1. Macro-tasks vs. Micro-tasks 馃敼 Macro-tasks (...00
KGKailash Gayariinexecution-context-and-call-stack.hashnode.dev路Jan 29, 2025 路 1 min readExecution Context & Call StackHow JavaScript Code Executes JavaScript uses a single-threaded model with an event loop. It executes code in two phases: Creation Phase: Memory allocation for variables and functions. Execution Phase: Runs the code line by line. Example: jsCopyEd...00
KGKailash Gayariinlearningjs.hashnode.dev路Jan 29, 2025 路 2 min readToday, I Learned About Micro and Macro Tasks in JavaScriptJavaScript is a single-threaded language, meaning it can only execute one operation at a time in its main thread. However, it uses an event loop to handle asynchronous tasks efficiently. Today, I explored an important concept in JavaScript: Microtask...00