functionf(){returnnewPromise((resolve,reject)=>{setTimeout(()=>{reject(0)},1000)})}asyncfunctionmain(){letfunc=[];try{func.push(f());for(letiof[1,2,3]){awaitf();}awaitPromise.all(func);}catch(e){console.log(e);}}main();为什么这样会报Unhandledpromiserejection,难道f()在放进func时就执行了吗,小白求解
慕哥9229398
相关分类