Ruby - Operators and Expressions
Which of the following is the correct way to check if a variable
x is truthy in Ruby?x is truthy in Ruby?if x automatically checks if x is truthy (not false or nil).if x == true only matches true, missing other truthy values; if x != nil treats false as truthy (false != nil); if x == nil checks the opposite of truthy.if x for truthy check [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions