Created
February 7, 2012 16:06
-
-
Save clutchski/1760428 to your computer and use it in GitHub Desktop.
compiled if expressions
This file contains 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
# This CoffeeScript compiles to ... | |
x = if 'a' in [1, 2, 3, 4] | |
1 | |
else if 'b' in [1, 2, 3, 4, 5] | |
2 | |
else if 'c' > 'd' | |
3 | |
else | |
4 | |
# This Javascript ... | |
(function() { | |
var x; | |
x = 'a' === 1 || 'a' === 2 || 'a' === 3 || 'a' === 4 ? 1 : 'b' === 1 || 'b' === 2 || 'b' === 3 || 'b' === 4 || 'b' === 5 ? 2 : 'c' > 'd' ? 3 : 4; | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment