Last active
December 26, 2015 00:59
-
-
Save john9631/7068086 to your computer and use it in GitHub Desktop.
W1
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
# Conventionally | |
if var < 900 | |
println("Hello World") | |
end | |
# Short circuit evaluation | |
var < 900 && print("Hello World") | |
# And Combined with Ternary | |
print(isa(varA, String) ? "string involved" : | |
isa(varB, String) ? "string involved" : | |
varA == varB ? "equal" : | |
varA > varB ? "bigger" : | |
varA < varB && "smaller") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment