title: How can I initialize an Array inside a Hash in Ruby
body: <p>I am trying to initialize a Hash of Arrays such as</p>
  
  <pre><code>@my_hash = Hash.new(Array.new)
  </code></pre>
  
  <p>so that I can:</p>
  
  <pre><code>@my_hash["hello"].push("in the street")
  =&gt; ["in the street"]
  @my_hash["hello"].push("at home")
  =&gt; ["in the street", "at home"]
  @my_hash["hello"]
  =&gt;["in the street", "at home"]
  </code></pre>
  
  <p>The problem is that any new hash key also return <code>["in the street", "at home"]</code></p>
  
  <pre><code>@my_hash["bye"]
  =&gt; ["in the street", "at home"]
  @my_hash["xxx"]
  =&gt; ["in the street", "at home"]
  </code></pre>
  
  <p>!!!???</p>
  
  <p>What am I doing wrong what would be the correct way to initialize a Hash of Arrays?</p>