Created
September 3, 2020 17:16
-
-
Save jamiebullock/23f47b9e42345b03f7a4cc93262f25ab to your computer and use it in GitHub Desktop.
Switch statement
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
switch (expression) | |
{ | |
case value1: | |
// code executed if expression matches value1 | |
[break;] | |
case value2: | |
// code executed if expression matches value2 | |
[break;] | |
... | |
case valueN: | |
// code executed if expression matches valueN | |
[break;] | |
[default: | |
// code executed if expression has no match | |
[break;]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment