Load a scenario and step forward to trace call stack dispatch and microtask scheduling.
Microtick Execution Waterfall
Click any node to inspect that historical stateWhy 90% of Engineers Misunderstand Await
⚠️ Await Pauses ONE Function, Not the Runtime
When JavaScript encounters await, it packages the remainder of that async function into a continuation microtask and immediately pops the function from the Call Stack. The calling code (e.g. forEach or synchronous statements below) keeps executing without delay.
🔄 Array.prototype.forEach Ignores Promises
Array.prototype.forEach is a synchronous loop implemented in ECMAScript specification. It fires its callback, completely ignores whatever that callback returns (even a pending Promise), and synchronously proceeds to the next iteration.
🛡️ The Correct Patterns
For sequential async processing, use for (const x of items) { await fn(x); }. For parallel concurrent execution with proper coordination, map items to promises and wait with await Promise.all(...).