Created
March 21, 2020 12:52
-
-
Save ricka/78781b3cbc2e0ab1050fff5229cafe46 to your computer and use it in GitHub Desktop.
Javascript Switch Alternative
This file contains 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
const dogSwitch = (breed) => ({ | |
"border": "Border Collies are good boys and girls.", | |
"pitbull": "Pit Bulls are good boys and girls.", | |
"german": "German Shepherds are good boys and girls." | |
})[breed] || "Default choice"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment