[1,2,3].forEach(function(el) {
if(el === 1) break;
});
How can I do this using the new forEach
method in JavaScript? I've tried return;
, return false;
and break
. break
crashes and return
does nothing but continue iteration.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…