Ruby - Variables and Data Types
You want to check if a variable
status is either true or nil in Ruby. Which condition correctly does this?status is either true or nil in Ruby. Which condition correctly does this?status is either true OR nil, so use logical OR (||).status == true || status == nil, which matches the requirement. if status == true && status == nil uses AND, which can never be true for both at once. if status || nil is incorrect syntax and logic. if status != false checks if status is not false, which includes other values too.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions