Sobes.tech
Junior — Senior

Determining the order of output to the console (example 36)

livecode

Task condition

Specify which order will be output to the console when executing the following code:

 console.log(1);

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

Promise.reject(3).catch(console.log);

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

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

console.log(6);

setTimeout(() => console.log(7),0);