Truthiness of a value can be used in if-else constructs
suggest changeYou do not need to use double negation in if-else statements.
if 'hello'
puts 'hey!'
else
puts 'bye!'
end
The above code prints ‘hey!’ on the screen.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents