Truthiness of a value can be used in if-else constructs

suggest change

You 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents