jquery each break
snippet in javascript

jquery each break

user4035

$.each(array, function(key, value) { 
    if(value === "foo") {
        return false; // breaks
    }
});

// or

$(selector).each(function() {
  if (condition) {
    return false;
  }
});

jquery continue each loop

user7730

return false; // this is equivalent of 'break' for jQuery loop
return;       // this is equivalent of 'continue' for jQuery loop