Skip to content

Instantly share code, notes, and snippets.

@jdfm
Last active August 29, 2015 14:23
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 jdfm/9590635cf5ae6845c816 to your computer and use it in GitHub Desktop.
Save jdfm/9590635cf5ae6845c816 to your computer and use it in GitHub Desktop.
it's possible to place a switch block right after an else (or an if(condition)) statement, making it look like an alternate conditional block
if ( condition ) {
// do the thing
} else switch ( state ) {
case 1: /* do something */ break;
default: case 2: /* do something else */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment