Skip to content
Junior–Senior161 views

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

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);
Frontend tasks in the code trainer