Created
May 14, 2014 21:17
-
-
Save carlosrojaso/acbb06168d91e13b8e24 to your computer and use it in GitHub Desktop.
JS Switch
This file contains hidden or 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
// A switch statement | |
switch ( foo ) { | |
case "bar": | |
alert( "the value was bar -- yay!" ); | |
break; | |
case "baz": | |
alert( "boo baz :(" ); | |
break; | |
default: | |
alert( "everything else is just ok" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment