Skip to main content
deleted 2 characters in body
Source Link
zord
  • 4.8k
  • 3
  • 28
  • 32

I realize this is a really old topic, but since my standard approach is not here yet, I thought I post it for the future googlers.

var a, b, abort = false; for (var a = 0; a < 10 && !abort; a++) { for (var b = 0; b < 10 && !abort; b++) { if (condition) { doSomeThing(); abort = true; } } } 

I realize this is a really old topic, but since my standard approach is not here yet, I thought I post it for the future googlers.

var abort = false; for (var a = 0; a < 10 && !abort; a++) { for (var b = 0; b < 10 && !abort; b++) { if (condition) { doSomeThing(); abort = true; } } } 

I realize this is a really old topic, but since my standard approach is not here yet, I thought I post it for the future googlers.

var a, b, abort = false; for (a = 0; a < 10 && !abort; a++) { for (b = 0; b < 10 && !abort; b++) { if (condition) { doSomeThing(); abort = true; } } } 
Source Link
zord
  • 4.8k
  • 3
  • 28
  • 32

I realize this is a really old topic, but since my standard approach is not here yet, I thought I post it for the future googlers.

var abort = false; for (var a = 0; a < 10 && !abort; a++) { for (var b = 0; b < 10 && !abort; b++) { if (condition) { doSomeThing(); abort = true; } } }