js中 Array.forEach如何跳出循环 forEach是不能通过break或者return跳出循环的,一般跳出循环的方式为抛出异常: try { let array = [1, 2, 3, 4] array.forEach((item, index) => { if (item === 3) { throw new Error('end'