Ruby - Control Flow
What will this Ruby code output?
value = 'b' case value.downcase when 'a' puts 'Letter A' when 'b' puts 'Letter B' else puts 'Unknown' end
What will this Ruby code output?
value = 'b' case value.downcase when 'a' puts 'Letter A' when 'b' puts 'Letter B' else puts 'Unknown' end
downcase keeps it 'b'.when 'b' matches, so it prints 'Letter B'.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions