Created
May 9, 2020 21:35
-
-
Save Nathan-Nesbitt/207abe2cbd4bad6c45dbbe0c446ab2e1 to your computer and use it in GitHub Desktop.
Better Switch Statement Example
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 fruit = "Apple"; | |
switch(fruit) { | |
case "Banana": | |
console.log("Loads of K"); | |
break; | |
case "Orange": | |
console.log("Zesty"); | |
break; | |
case "Apple": | |
console.log("Pomme"); | |
break; | |
default: | |
console.log("I don't like that fruit"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample code for https://nathan.nesbitt.ca/blog-posts/IntroductionToJavascript.html