js跳出forEach循环
参考:https://blog.csdn.net/qq_2411868438/article/details/124447051
try { array.forEach((element) => { if ((element.id == 3)) { throw Error("msg"); } }); } catch (error) { console.log(error); }
参考:https://blog.csdn.net/qq_2411868438/article/details/124447051
try { array.forEach((element) => { if ((element.id == 3)) { throw Error("msg"); } }); } catch (error) { console.log(error); }