Programming-Idioms

History of Idiom 43 > diff from v5 to v6

Edit summary for version 6 :

Version 5

2015-07-31, 19:51:07

Version 6

2015-08-01, 17:37:04

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Code
OUTER:
for (var i in m) {
   for (var i in m[i]) {
      if (m[i][j] < 0) {
         console.log("Negative value found: "+m[i][j]);
         break OUTER;
      }
   }
}