Created
March 7, 2012 15:10
-
-
Save bga/1993712 to your computer and use it in GitHub Desktop.
[fun] various forms of ternary operator in JavaScript
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
// add your variants of | |
a ? b : c | |
// in comments :) | |
// a is boolean | |
// b and c - any type | |
// lazy evaluation isnt important |
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
@jneira I love that lambda calculus inspired version. How about this? (Credits to you, this is just sugar)