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

A timer callback in the timers phase synchronously schedules both a `process.nextTick` and a `queueMicrotask`. At the boundary right after this single timer callback returns, in what order does Node process them, and relative to the NEXT expired timer in the same timers phase?

setTimeout(() => { process.nextTick(() => console.log('nt')); queueMicrotask(() => console.log('mt')); }, 0); setTimeout(() => console.log('timer2'), 0);