Skip to content

Instantly share code, notes, and snippets.

@pasberth
Created June 7, 2014 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pasberth/ea27815b8673edba1e33 to your computer and use it in GitHub Desktop.
Save pasberth/ea27815b8673edba1e33 to your computer and use it in GitHub Desktop.
goto
function main(label) {
var i = 10;
GOTO:
while (true) {
switch (label) {
case "label1":
if (i == 0) {
console.log("ok!");
label = "label2";
continue GOTO;
} else {
i -= 1;
console.log("i--");
continue GOTO;
}
break;
case "label2":
console.log("label2!!!");
break;
}
break;
}
}
main("label1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment