Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptpractical event-loop modelSingle-choice MCQ

Microtasks scheduled during microtask draining still run before the next macrotask. What order is logged?

setTimeout(() => console.log(1), 0); Promise.resolve() .then(() => console.log(2)) .then(() => console.log(3)); Promise.resolve().then(() => console.log(4));