title: How to push a value to an array value in a hash
body: <p>I'm trying to set different arrays as the values of a hash using a range, then push a value into one of the arrays. I want this outcome:</p>
  
  <pre><code>hash[0] &lt;&lt; 3 
  hash #=&gt; {0=&gt;[3], 1=&gt;[], 2=&gt;[], 3=&gt;[]}
  </code></pre>
  
  <p>I did this:</p>
  
  <pre><code>hash = Hash[(0..9).to_a.product([Array.new(0)])]
  #=&gt; {0=&gt;[], 1=&gt;[], 2=&gt;[], 3=&gt;[], 4=&gt;[], 5=&gt;[], 6=&gt;[], 7=&gt;[], 8=&gt;[], 9=&gt;[], 10=&gt;[]}
  hash[0] &lt;&lt; 3 #=&gt; [3]
  hash #=&gt; {0=&gt;[3], 1=&gt;[3], 2=&gt;[3], 3=&gt;[3], 4=&gt;[3], 5=&gt;[3], 6=&gt;[3], 7=&gt;[3], 8=&gt;[3], 9=&gt;[3], 10=&gt;[3]}
  </code></pre>
  
  <p>I assume the reason I get the output is because all my keys are referencing the same array instead of different arrays.</p>
  
  <p>How could I get the expected outcome?</p>