Skip to content

Instantly share code, notes, and snippets.

@Marak
Forked from heapwolf/insanity
Created June 18, 2010 04:51
Show Gist options
  • Select an option

  • Save Marak/443256 to your computer and use it in GitHub Desktop.

Select an option

Save Marak/443256 to your computer and use it in GitHub Desktop.
function doit() {
INSANITY:
for(var i=1; i < 20; i++) {
if(i == 10) {
continue INSANITY;
}
console.log(i);
}
}
doit();
@Marak
Copy link
Author

Marak commented Jun 18, 2010

DONT DO IT!

I call it go-control. its like goto + flow control.

:-(

@rmanalan
Copy link

rmanalan commented Oct 6, 2011

wild... didn't know that this existed. thx.

@Marak
Copy link
Author

Marak commented Oct 6, 2011

I have another one somewhere from @hij1nx or @bmeck that has a nested switch / case with multiple label jumps ( gotos ).

I can't seem to find it, probably better that way.

@pvdz
Copy link

pvdz commented Oct 8, 2011

function(){
  jump: {
    code;
    code;
    break jump; // look mom, no loop
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment