Ruby - Hashes
Fix the error in this Ruby code that tries to assign a unique array to each missing key:
h = Hash.new([]) h[:a] << 1 puts h[:a].inspect
h = Hash.new([]) h[:a] << 1 puts h[:a].inspect
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions