Skip to content

Instantly share code, notes, and snippets.

@marcelaraujo
Created March 10, 2015 14:27
Show Gist options
  • Select an option

  • Save marcelaraujo/eadd1e246ff4dd0b308c to your computer and use it in GitHub Desktop.

Select an option

Save marcelaraujo/eadd1e246ff4dd0b308c to your computer and use it in GitHub Desktop.
Javascript labeled loop
var i = 0,
j = 8;
checkiandj: while (i < 4) {
console.log("i: " + i);
i += 1;
checkj: while (j > 4) {
console.log("j: "+ j);
j -= 1;
if ((j % 2) == 0)
continue checkj;
console.log(j + " is odd.");
}
console.log("i = " + i);
console.log("j = " + j);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment