_.each(users, function(u, index) {
if (u.superUser === false) {
return;
//this does not break. _.each will always run
//the iterator function for the entire array
//return value from the iterator is ignored
}
//Some code
});
Side note that with lodash (not underscore) _.forEach if you DO want to end the “loop” early you can explicitly return false from the iteratee function and lodash will terminate the forEach loop early.