如何跳出foreach循环 毛師爺 2019-05-22 817 阅读1分钟 foreach中使用return是不能跳出循环的,若要跳出循环,可以添加 try{ arr.foreach(item => { if() { throw new Error('') } }) }catch(err){ }