title: Fastest way to duplicate an array in JavaScript - slice vs. 'for' loop
body: <p>In order to duplicate an array in JavaScript: Which of the following is faster to use?</p>
  <h3><code>Slice</code> method</h3>
  <pre><code>var dup_array = original_array.slice();
  </code></pre>
  <h3><code>For</code> loop</h3>
  <pre><code>for(var i = 0, len = original_array.length; i &lt; len; ++i)
     dup_array[i] = original_array[i];
  </code></pre>
  <hr />
  <p>I know both ways do only a <strong>shallow copy</strong>: if <code>original_array</code> contains references to objects, objects won't be cloned, but only the references will be copied, and therefore both arrays will have references to the same objects.
  But this is not the point of this question.</p>
  <p>I'm asking only about speed.</p>