Created
September 1, 2019 03:31
-
-
Save heinthanth/d429b62cc826f486e556cf768bd43888 to your computer and use it in GitHub Desktop.
Switch with Multiple Condition
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
var x = "bar"; | |
switch(x) { | |
case "foo": | |
case "bar": | |
// will execute if x is either "foo" or "bar" | |
break; | |
case "baz": | |
// will execute if x is neither "foo" nor "bar" | |
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