Created
December 15, 2015 03:04
-
-
Save deep-spaced/6f3a7bf943f42437da50 to your computer and use it in GitHub Desktop.
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
def odd(n) | |
n%2 != 0 | |
end | |
# Here's what we expect: | |
if a = odd(5) and a == true | |
puts "a is odd" | |
end | |
# => "a is odd" | |
# But this isn't quite the same: | |
if b = odd(5) && b == true | |
puts "b is odd" | |
end | |
# => nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment