/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
h1 = {'1'=>'a', '2'=>'b', '3'=>'c', '4'=>'z'} h2 = {'4'=>'e'} puts h1.inspect # => {"1"=>"a", "2"=>"b", "3"=>"c", "4"=>"z"} h1.update(h2) puts h1.inspect # => {"1"=>"a", "2"=>"b", "3"=>"c", "4"=>"e"}