forEach 终止循环

 1 let arr= ['baidu', 'google', 'taobao'];
 2 try{
 3   arr.forEach(item=>{
 4     if(item == 'google'){
 5       throw new Error();
 6     }
 7   })  
 8 }catch(e){
 9    return;
10 }
原文地址:https://www.cnblogs.com/Blogzlj/p/13033128.html