串行执行三个promiseA、B和C
串行执行三个promiseA、B和C
1. 方法1:promise
// 方法1:promise A.then(B).then(C).catch(...)
2. 方法2:async/await
// 方法2:async/await
(async () => {
await a();
await b();
await c();
})() JavaScript 文章被收录于专栏
前端技术分享
// 方法1:promise A.then(B).then(C).catch(...)
// 方法2:async/await
(async () => {
await a();
await b();
await c();
})() 前端技术分享
相关推荐