Last active
August 29, 2015 14:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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