Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubypattern matching case inSingle-choice MCQ

An array pattern and a hash pattern are matched against the same data. Given the snippet, what is the result?

case [1, 2, 3] in [Integer, Integer] puts "two" in [Integer, Integer, Integer] puts "three" end case {name: "Ada", age: 36} in {name: String => n} puts "hash: #{n}" end