How can I break out of the next jquery of each method when the condition is met
var rainbow = {'first' : 'red', 'second' : 'orange', 'third' : 'yellow'};
$.each(rainbow, function (key, color) {
if (color == 'red') {
alert("i'm read, now break.");
}
});
source
share