Hint
All sync code finishes before any macrotask (setTimeout) runs — even with 0ms delay.
console.log('1');
setTimeout(() => console.log('2'), 0);
console.log('3');1 3 2
Explanation: Synchronous code runs first (1, 3). setTimeout callbacks are macrotasks — they run after all synchronous code.
Key Insight: All sync code finishes before any macrotask (setTimeout) runs — even with 0ms delay.