setTimeout(() => { console.log(1) }, 0) let promise1 = new Promise((res, reject) => { res(2) console.log(3) }); let promise2 = new Promise((res, reject) => { res(4) console.log(5) }); setTimeout(() => { console.log(6) }, 0) promise1.then(res => { console.log(res) }).catch().finally(_ => { console.log(7) }) promise2.then(res => { console.log(res) })