循环中使用await,出错时不中断 Ooo 2020-04-22 810 阅读1分钟 asnyc funciton my (){ [2,2].forEach(e=>{ await test() }) } asnyc function test(){ throw new Error() } 上述这种写法不行,在回调中并不会中断主函数 改为普通for循环