How to copy or duplicate an array of arrays
<p>I'm trying to make a function that duplicates an array of arrays. I tried blah.slice(0); but it only copies the references. I need to make a duplicate that leaves the original intact. </p>

<p>I found this prototype method at <a href="http://my.opera.com/GreyWyvern/blog/show.dml/1725165" rel="nofollow">http://my.opera.com/GreyWyvern/blog/show.dml/1725165</a></p>

<pre><code>Object.prototype.clone = function() {
  var newObj = (this instanceof Array) ? [] : {};
  for (i in this) {
    if (i == 'clone') continue;
    if (this[i] &amp;&amp; typeof this[i] == "object") {
      newObj[i] = this[i].clone();
    } else newObj[i] = this[i]
  } return newObj;
};
</code></pre>

<p>It works, but messes up a jQuery plugin I'm using - so I need to turn it onto a function... and recursion isn't my strongest. </p>

<p>Your help would be appreciated!</p>

<p>Cheers,</p>
