Tagged articles
10 articles
Page 1 of 1
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 12, 2025 · Frontend Development

Understanding and Implementing Vue's nextTick Mechanism

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.

AsyncJavaScriptPromise
0 likes · 10 min read
Understanding and Implementing Vue's nextTick Mechanism
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 24, 2023 · Frontend Development

Understanding JavaScript Event Loop, Microtasks and Macrotasks

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.

JavaScriptevent loopfrontend development
0 likes · 7 min read
Understanding JavaScript Event Loop, Microtasks and Macrotasks
ByteFE
ByteFE
Nov 8, 2022 · Frontend Development

Understanding the JavaScript Event Loop in Browsers and Node.js

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.

AsyncBrowserJavaScript
0 likes · 18 min read
Understanding the JavaScript Event Loop in Browsers and Node.js
Sohu Tech Products
Sohu Tech Products
Oct 19, 2022 · Fundamentals

Understanding the JavaScript Event Loop in Browsers and Node.js

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.

AsyncBrowserJavaScript
0 likes · 17 min read
Understanding the JavaScript Event Loop in Browsers and Node.js
Tencent Cloud Developer
Tencent Cloud Developer
May 31, 2021 · Frontend Development

Understanding Vue.nextTick and the JavaScript Event Loop

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.

JavaScriptVue.jsevent loop
0 likes · 12 min read
Understanding Vue.nextTick and the JavaScript Event Loop
Node Underground
Node Underground
Nov 16, 2019 · Frontend Development

How V8 Optimizes async/await: Cutting Microtasks for Faster JavaScript

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.

JavaScript optimizationNode.jsV8
0 likes · 5 min read
How V8 Optimizes async/await: Cutting Microtasks for Faster JavaScript
Xueersi Online School Tech Team
Xueersi Online School Tech Team
Jul 12, 2019 · Fundamentals

Understanding Google V8 Engine Promise Implementation and the JavaScript Event Loop

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.

AsyncJavaScriptPromise
0 likes · 10 min read
Understanding Google V8 Engine Promise Implementation and the JavaScript Event Loop
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Oct 23, 2018 · Frontend Development

Mastering JavaScript Macrotasks, Microtasks, and Promise Timing

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.

JavaScriptPromiseevent loop
0 likes · 13 min read
Mastering JavaScript Macrotasks, Microtasks, and Promise Timing
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Sep 30, 2018 · Fundamentals

Why Does setTimeout Run After Promise.then? Unraveling JavaScript’s Event Loop

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.

AsyncBrowserJavaScript
0 likes · 9 min read
Why Does setTimeout Run After Promise.then? Unraveling JavaScript’s Event Loop
MaoDou Frontend Team
MaoDou Frontend Team
Jul 14, 2018 · Frontend Development

Mastering JavaScript Event Loop: Microtasks, Macrotasks, and Async Tricks

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.

event-loopmacrotasksmicrotasks
0 likes · 11 min read
Mastering JavaScript Event Loop: Microtasks, Macrotasks, and Async Tricks