Skip to content

Instantly share code, notes, and snippets.

@deep-spaced
Created December 15, 2015 03:04
Show Gist options
  • Save deep-spaced/6f3a7bf943f42437da50 to your computer and use it in GitHub Desktop.
Save deep-spaced/6f3a7bf943f42437da50 to your computer and use it in GitHub Desktop.
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