forEach 如何提前终止 跳出运行时间:2023-03-10 05:56:07 forEach 如何提前终止 跳出运行 try{ arr.forEach(function(item,index){ if (...) { foreach.break=new Error("StopIteration"); } }); }catch(e){ if(e.message==="foreach is not defined") { return; }else throw e; } 《JavaScript权威指南(6版)》7.9.1 forEach() .