title: Why does splice() change both Arrays?
body: <p>Look at the following code:</p>
  
  <pre><code>var x = [1, 2, 3], y;
  y = x;
  y.splice(0,0,4);
  </code></pre>
  
  <p>which gives:</p>
  
  <pre><code>y = [4, 1, 2, 3]    //  (correct)
  
  x = [4, 1, 2, 3]    //  (why did this change too?)
  </code></pre>
  
  <p>Why did the <code>x</code> array change when I called <code>.splice()</code> on <code>y</code>?</p>