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

What does this print, and why does the second timer's microtask placement matter?

setTimeout(() => { console.log('A'); Promise.resolve().then(() => console.log('a')); }, 0); setTimeout(() => { console.log('B'); Promise.resolve().then(() => console.log('b')); }, 0);