I have the following scenario:
$.each(array, function() {
...
$.each(array1, function() {
if condition () { }
});
});
How can I break out of outer each
loop when my condition evaluates to true inside the inner each
loop?
I have the following scenario:
$.each(array, function() {
...
$.each(array1, function() {
if condition () { }
});
});
How can I break out of outer each
loop when my condition evaluates to true inside the inner each
loop?
$.each(array, function() {
var flag = true;
$.each(array1, function() {
if (condition) {
flag = false;
return false;
}
});
return flag;
});