new Promise((resolve, reject) => { console.log("async1 start"); console.log("async2");
resolve(Promise.resolve());
}).then(() => { console.log("async1 end");
});new Promise(function(resolve) { console.log("promise1");
resolve();
}).then(function() { console.log("promise2");
}).then(function() { console.log("promise3");
}).then(function() { console.log("promise4");
});执行结果如下:
async1 start
async2
promise1
promise2
promise3
async1 end
promise4
求大神解释结果为什么是这样的?
噜噜哒
青春有我
随时随地看视频慕课网APP
相关分类