Ruby - Hashes
What will be the output of this Ruby code?
h = {a: 1, b: 2}
h[:b] = 5
puts h[:b]h = {a: 1, b: 2}
h[:b] = 5
puts h[:b]h[:b] = 5 updates the value of key :b from 2 to 5.puts h[:b] prints 5.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions