Junior — Senior
Determine the order of output to the console (example 107)
livecode
Task condition
You need to understand in what order the numbers will be printed when executing the following JavaScript code.
setTimeout(() =>
new Promise((resolve) => {
console.log(3);
resolve(null);
}).then(() => console.log(4))
);
setTimeout(() => console.log(5));
Promise.resolve().then(() => console.log(1));
console.log(6);
setTimeout(() => console.log(7));
console.log(2);