-
-
Save maxd/76e924d147d60cdc003c to your computer and use it in GitHub Desktop.
if-else and ternary operator in Ruby
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
2.1.5 :017 > puts (if true then 1 else 0 end) | |
1 | |
=> nil | |
2.1.5 :018 > puts (true ? 1 : 0) | |
1 | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment