1$.each(array, function(key, value) {
2 if(value === "foo") {
3 return false; // breaks
4 }
5});
6
7// or
8
9$(selector).each(function() {
10 if (condition) {
11 return false;
12 }
13});
1return false; // this is equivalent of 'break' for jQuery loop
2return; // this is equivalent of 'continue' for jQuery loop
1$.each(array, function(key, value) {
2 if(value === "foo") {
3 return false; // breaks
4 }
5});
6
7// or
8
9$(selector).each(function() {
10 if (condition) {
11 return false;
12 }
13});
14