title: Store result of array.sort in another variable
body: <p>This seems like a simple question but I can't find much info on this.</p>
  
  <pre><code>var array1 = new Array(4, 3, 1, 2, 0, 5);
  var array2 = array1;
  array2.sort(function(a, b) {
      return a - b;
  })
  </code></pre>
  
  <p><strong>Expected behavior:</strong> array2 is sorted and array1 is in the original order starting with 4.</p>
  
  <p><strong>Actual result:</strong> both arrays are sorted.</p>
  
  <p>How can I sort array1 - while maintaining array1 and storing the results of the sort in array2? I thought that doing <code>array2 = array1</code> would copy the variable, not reference it. However, in Firefox's console both arrays appear sorted.</p>