async function 定义返回的Promise对象状态是fulfilled
来源:8-11 async-await和Promise有什么关系

那些青春很年少
2021-05-09
async function test(){
return 100
}
const p1 = test();
console.log(“p1”, p1);
p1.then(data =>{
console.log(‘data’, data)
})
写回答
1回答
-
对,就相当于直接定义 const p1 = new Promise((resolve) => { resolve(100) })
012021-05-09
相似问题
Promise.resolve状态
回答 1
async
回答 2