Duplicate array - Node.js Array

Node.js examples for Array:Array Operation

Description

Duplicate array

Demo Code

Array.prototype.dup = function()
{
  var copy = [];/*from  www.ja  va  2  s .  c  o m*/
  for (var i = 0; i < this.length; i++)
    copy[i] = this[i];
  return copy;
};

Related Tutorials