Skip to content

Instantly share code, notes, and snippets.

@hdragomir
Created October 10, 2012 11:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdragomir/3865145 to your computer and use it in GitHub Desktop.
Save hdragomir/3865145 to your computer and use it in GitHub Desktop.
Switch Default
switch (num) {
case 1:
'do your stuff';
break;
default:
case 2:
'do other stuff';
break;
case 3:
'more stuff';
break;
}
@hdragomir
Copy link
Author

That moment when you realize your default case does not need to be at the end!

@gorenje
Copy link

gorenje commented Oct 10, 2012

+1 for obfuscation!

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