Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bga/1993712 to your computer and use it in GitHub Desktop.
Save bga/1993712 to your computer and use it in GitHub Desktop.
[fun] various forms of ternary operator in JavaScript
// add your variants of
a ? b : c
// in comments :)
// a is boolean
// b and c - any type
// lazy evaluation isnt important
@jneira
Copy link

jneira commented Mar 13, 2012

better, but credits to Alonzo Church!, we are simple mortals

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