1//break out of for loop
2for (i = 0; i < 10; i++) {
3 if (i === 3) { break; }
4}
1var BreakException = {};
2
3try {
4 [1, 2, 3].forEach(function(el) {
5 console.log(el);
6 if (el === 2) throw BreakException;
7 });
8} catch (e) {
9 if (e !== BreakException) throw e;
10}