Sobes.tech
Back to tasks
Junior — Senior
26

Определение последовательности вывода в консоль (задача 67)

Get help with live coding in real time with Sobes Copilot
Task condition

В какой последовательности будут напечатаны сообщения, вызванные console.log?

console.log('1');
setTimeout(() => {
    console.log('2');
});
new Promise((resolve, reject) => {
    console.log('3');
    resolve();
}).then(() => {
    console.log('4');
});
Promise.resolve().then(() => {
    console.log('5');
}).then(() => {
    console.log('6');
});
Promise.resolve().then(() => {
    console.log('7');
}).then(() => {
    console.log('8');
});
console.log('9');