怎么跳出foreach foreach不是普通的for循环,而是一个函数,跳出函数要用return。break只能跳出普通的for循环 array1.forEach(value=> { if(value==1){ return; } });