Problem Statement
Given the code below, what is the output order?
Explanation
Synchronous logs run first, then microtasks (Promises) run before macrotasks (setTimeout).
Code Solution
SolutionRead Only
console.log('Start');
setTimeout(() => console.log('Timeout'), 0);
Promise.resolve().then(() => console.log('Promise'));
console.log('End');Practice Sets
This question appears in the following practice sets:
