Skip to content

Instantly share code, notes, and snippets.

@jackfranklin
Last active December 10, 2015 23:39
Show Gist options
  • Select an option

  • Save jackfranklin/4511417 to your computer and use it in GitHub Desktop.

Select an option

Save jackfranklin/4511417 to your computer and use it in GitHub Desktop.
Ruby operator precedence
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