Tagged articles
Microtasks
12 articles · Page 1 of 1
This article explains JavaScript's single-threaded event loop model, detailing microtask and macrotask queues, Promise chaining, async/await mechanics, common pitfalls, and practical concurrency control patterns with code examples. It covers classic output prediction exercises, Promise.all/race/allSettled/any usage, async/await error handling, loop await traps, and a reusable limited-concurrency pool implementation for batch requests.
Async/AwaitJavaScriptMacrotasks
0 likes · 12 min read

This article dissects 10 common misconceptions about JavaScript's await keyword, explaining how it evaluates expressions, waits only for Promise settlement — not side effects — and why patterns like forEach with async callbacks, bare setTimeout, and Promise.all can cause silent bugs in production.
Async/AwaitConcurrencyDistributed Systems
0 likes · 16 min read

This article explains the inner workings of Vue's nextTick function, detailing its callback queue, flushing logic, timer selection across environments, Promise‑based return, and provides a step‑by‑step JavaScript implementation with test cases and the full Vue source code.
JavaScriptMicrotasksPromise
0 likes · 10 min read

This article explains JavaScript’s single‑threaded nature, the event loop mechanism, and the distinction between microtasks and macrotasks, illustrating their execution order with detailed code examples and step‑by‑step analysis to help developers grasp asynchronous behavior in front‑end development.
Frontend DevelopmentJavaScriptMacrotasks
0 likes · 7 min read


ByteFENov 8, 2022 · Frontend Development
This article explains the fundamentals of JavaScript's event loop, covering browser asynchronous execution, macro‑ and micro‑tasks, timer inaccuracies, view rendering, and the differences in Node.js implementation, while providing code examples to illustrate execution order and practical implications for developers.
JavaScriptMacrotasksMicrotasks
0 likes · 18 min read

This article explains the fundamentals of JavaScript's event loop, covering single‑threaded execution, the role of macro‑tasks and micro‑tasks, differences between browser and Node.js implementations, and includes code examples that illustrate task scheduling and execution order.
JavaScriptMacrotasksMicrotasks
0 likes · 17 min read

Vue.nextTick schedules callbacks using a graceful‑degradation chain (Promise, MutationObserver, setImmediate, setTimeout) that leverages the JavaScript event‑loop’s micro‑task queue, ensuring DOM mutations are applied instantly but rendered after microtasks and before macrotasks, while the browser’s multi‑threaded architecture coordinates rendering, timers, and network work.
Frontend DevelopmentJavaScriptMicrotasks
0 likes · 12 min read

This article explains how V8 reduces the number of microtasks created by async/await by eliminating redundant Promise wrappers and streamlining then‑handlers, showing the original transformation code, the optimizations applied, and the resulting execution order in both browsers and Node.js.
Async/AwaitJavaScript optimizationMicrotasks
0 likes · 5 min read

This article explains the evolution of Google V8's Promise implementation, details the JavaScript single‑threaded event loop with macro‑ and micro‑tasks, describes various programming models, and walks through the internal V8 code that realizes Promise construction, chaining, and utility methods such as Promise.all and Promise.race.
JavaScriptMicrotasksPromise
0 likes · 10 min read

This article explains the differences between macrotasks and microtasks in the JavaScript event loop, shows how they affect Promise execution, provides practical code examples, and discusses how frameworks like Vue implement task scheduling, helping developers avoid dead‑loops and improve performance.
JavaScriptMacrotasksMicrotasks
0 likes · 13 min read

This article explains how JavaScript’s single‑threaded model achieves asynchronous behavior through macro‑tasks and micro‑tasks, compares the browser and Node.js event‑loop implementations, and demonstrates the timing differences between setTimeout, setImmediate, and process.nextTick with practical code examples.
JavaScriptMicrotasksNode.js
0 likes · 9 min read

This article thoroughly explains JavaScript's single‑threaded nature and Event Loop, detailing how synchronous and asynchronous tasks are queued as macro‑tasks or micro‑tasks, and demonstrates their behavior with code examples, diagrams, and analysis of setTimeout, setInterval, Promise and process.nextTick.
MacrotasksMicrotasksevent-loop
0 likes · 11 min read
