Skip to content

Instantly share code, notes, and snippets.

@Nathan-Nesbitt
Created May 9, 2020 21:35
Show Gist options
  • Save Nathan-Nesbitt/207abe2cbd4bad6c45dbbe0c446ab2e1 to your computer and use it in GitHub Desktop.
Save Nathan-Nesbitt/207abe2cbd4bad6c45dbbe0c446ab2e1 to your computer and use it in GitHub Desktop.
Better Switch Statement Example
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");
}
@Nathan-Nesbitt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment