Ruby - Operators and Expressions
Identify the bug in this Ruby code:
value = false if value.nil? puts "Falsy" else puts "Truthy" end
value = false if value.nil? puts "Falsy" else puts "Truthy" end
value.nil? returns true only if value is nil, but here value is false.if !value to check both false and nil.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions