Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardNodeJSmicrotasks vs timer phaseSingle-choice MCQ

Within one event-loop iteration, where do Promise microtasks get drained relative to the macrotask phases (timers, poll, check)?

setTimeout(() => { Promise.resolve().then(() => console.log('promise')); process.nextTick(() => console.log('nextTick')); console.log('sync'); }, 0); // Output: sync, nextTick, promise