Sobes.tech
Junior — Senior

Determining the order of output in the JavaScript code console

livecode

Task condition

You need to specify which values will appear in the console and in what order when executing the following script.

 console.log(1);

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

setTimeout(() => {
    console.log(3)
    Promise.resolve().then(() => console.log(3.1))
}, 0);

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

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

console.log(6)