Hint
await suspends the async function. The caller continues synchronously. The resumed code runs as a microtask.
console.log('1');
async function main() {
console.log('2');
await Promise.resolve();
console.log('3');
}
main();
console.log('4');1 2 4 3
Explanation: 1 logs. main() starts, logs 2. await suspends main (schedules resume as microtask). 4 logs. Then microtask runs: 3 logs.
Key Insight: await suspends the async function. The caller continues synchronously. The resumed code runs as a microtask.