Sobes.tech
Junior — Senior

Order of output to the console (example 57)

livecode

Task condition

Determine the order in which messages will appear in the console when executing the following code:

Promise.resolve(1)
    .then(x => console.log(1))
    .catch(x => console.log(2))
    .then(x => console.log(3))

Promise.reject(2)
    .then(x => console.log(4))
    .catch(x => console.log(6))
    .then(x => console.log(7))