Created
September 3, 2020 17:18
-
-
Save jamiebullock/ef5c35514f5ad114c1ac381bf0696747 to your computer and use it in GitHub Desktop.
Colour 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
switch (colour) | |
{ | |
case 'red': | |
case 'amber': | |
stop(); | |
break; | |
case 'green': | |
case 'flashing amber': | |
go(); | |
break; | |
default: | |
throw 'Invalid colour'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment