title: Copy array by value
body: <p>When copying an array in JavaScript to another array:</p>
  
  <pre><code>var arr1 = ['a','b','c'];
  var arr2 = arr1;
  arr2.push('d');  //Now, arr1 = ['a','b','c','d']
  </code></pre>
  
  <p>I realized that <code>arr2</code> refers to the same array as <code>arr1</code>, rather than a new, independent array. How can I copy the array to get two independent arrays?</p>