Sobes.tech
Junior — Senior

Determine the order of output to the console

livecode

Task condition

Specify the order in which messages will appear in the console when executing the following code:

 console.log(1);

setTimeout(() => console.log(2));

Promise.resolve().then(() => console.log(3));

Promise.resolve().then(() => setTimeout(() => console.log(4)));

Promise.resolve().then(() => console.log(5));

setTimeout(() => console.log(6));

console.log(7);