new promise中的函数(excutor)会同步执行 先resolve(1) 再把then中的 console(r)放入微任务队列中 此时r为resolve的参数1然后再执行打印2同步任务执行完执行微任务 打印1
new promise中的函数(excutor)会同步执行
先resolve(1) 再把then中的 console(r)放入微任务队列中 此时r为resolve的参数1
然后再执行打印2
同步任务执行完
执行微任务 打印1