Ruby - Hashes
What will this Ruby code print?
h = { :x => 10, "x" => 20 }
puts h[:x] + h["x"]h = { :x => 10, "x" => 20 }
puts h[:x] + h["x"]h[:x] is 10 and h["x"] is 20 because symbol and string keys are different.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions