js
new Promise((resolve, rejcet) => {
console.log('promise1');
resolve();
}).then(() => {
console.log('then11');
new Promise((resolve, reject) => {
console.log('promise2');
resolve();
}).then(() => {
console.log('then21');
}).then(() => {
console.log('then23');
})
}).then(() => {
console.log('then12');
})

我以为then是同时执行的,即异步。其实then是同步的,只能一个个执行,等待一个执行完毕了才能走下一个
他这里两个then,就是说,不会一次一起执行then,把then里面的东西放入微任务,而是把一个then当作一轮循环来执行了。
的确,不了解的话,写代码容易出现执行顺序不对的问题