let data = await Promise.all(
arr.map(async (ele) => {
if (ele>0) {
let result = await Promise.all([接口])
return result;
console.log(111111)
} else {
return ele;
}
}),
)
console.log(222222)
如题,我希望可以等待接口返回后再返回数组,但是却先打印出2222222222,在打印出1111111111111,请问要如何解决?
https://codesandbox.io/s/eloquent-sara-027hq3?file=/src/index.js