Created
July 24, 2017 21:50
-
-
Save doug-numetric/39b1ae184fd95c343fc2978849f0a8eb to your computer and use it in GitHub Desktop.
ESList and nested conditional operators
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
/* | |
* What are your thoughts on nested conditionals? | |
* replacing with if/else if/else statements removes your ability to use const | |
* ESLint doesn't like them, but for cascading if/else flows, I think proper formatting | |
* eliminates readability concerns | |
*/ | |
const word = | |
isFoo ? 'a' : // if isFoo | |
isBar ? 'b' : // else if isBar | |
isBaz ? 'c' : // else if isBaz | |
'd' ; // else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment