title: How to retain array in javascript?
body: <p>Here's some code that has two arrays(np and op), one a copy of the other</p>
  
  <p>However, when I modify the copy, the original is also modified!
  take a look:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var op=new Array(0, 0);
  var np=op;
  np[1]=2;
  document.write(op+"&lt;br&gt;")
  document.write(np)
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there any way to retain the original and modify the copy?</p>