Skip to content

Instantly share code, notes, and snippets.

@jhs
Last active September 28, 2015 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhs/1421499 to your computer and use it in GitHub Desktop.
Save jhs/1421499 to your computer and use it in GitHub Desktop.
A better case statement?
// Prettier case statement, but can also return a value since it is an expression.
//
first_condition
? first_action()
: second_condition
? second_action()
: third_condition && can && (be || compound)
? action_3()
: default_action()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment