📅  最后修改于: 2022-03-11 15:01:41.138000             🧑  作者: Mango
var BreakException = {};
try {
[1, 2, 3].forEach(function(el) {
console.log(el);
if (el === 2) throw BreakException;
});
} catch (e) {
if (e !== BreakException) throw e;
}