【发布时间】:2022-02-11 01:00:18
【问题描述】:
有什么区别
const foo = async () => {
// some other code that uses await
return await bar()
}
和
const foo = async () => {
// some other code that uses await
return bar()
}
bar 是一个返回承诺的函数。
await 是多余的还是有什么不同?
【问题讨论】:
标签: javascript async-await es6-promise