Skip to content

Instantly share code, notes, and snippets.

@michaelfairley
Created June 16, 2011 05:12
Show Gist options
  • Save michaelfairley/1028707 to your computer and use it in GitHub Desktop.
Save michaelfairley/1028707 to your computer and use it in GitHub Desktop.
or vs. || and and vs. &&
a = nil || 1
puts a # prints 1
b = nil or 1
puts b # prints nil
c = 1 && 2
puts c # prints 2
d = 1 and 2
puts d # prints 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment