165 views
Determining the order of output to the console (example 88)
Asked at
Task condition
Specify which values and in what order they 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);