Last active
December 10, 2015 23:39
-
-
Save jackfranklin/4511417 to your computer and use it in GitHub Desktop.
Ruby operator precedence
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
| a = "foo" && b = "bar" | |
| a = ("foo" && b = "bar") | |
| "bar" | |
| # returns "bar" | |
| a == "bar" # true | |
| a = "foo" and b = "bar" | |
| (a = "foo") and b = "bar" | |
| "bar" | |
| # returns "bar" | |
| a == "foo" # true | |
| ## in Ruby, && > = > and |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment