Skip to content

Instantly share code, notes, and snippets.

@doug-numetric
Created July 24, 2017 21:50
Show Gist options
  • Save doug-numetric/39b1ae184fd95c343fc2978849f0a8eb to your computer and use it in GitHub Desktop.
Save doug-numetric/39b1ae184fd95c343fc2978849f0a8eb to your computer and use it in GitHub Desktop.

Revisions

  1. doug-numetric created this gist Jul 24, 2017.
    12 changes: 12 additions & 0 deletions conditionalFormatting.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    /*
    * 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