Created
September 1, 2019 03:26
-
-
Save heinthanth/984f378f75b051137f1b83c0996b1ca1 to your computer and use it in GitHub Desktop.
Switch
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
var x = 2; | |
switch(x) { | |
case 1: | |
// do something | |
break; | |
case 2: | |
// will execute since x = 2 | |
break; | |
default: | |
// will execute if x is not each of all above | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment