Array: Duplicate


/ Published in: ActionScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Array.prototype._duplicate = function() {
  2. /*
  3. * This returns a duplicate of the array
  4. */
  5. var newAry:Array = new Array();
  6. var ary_length = this.length;
  7. for (var i=0;i < ary_length; ++i){
  8. newAry.push( this[i] );
  9. }
  10.  
  11. return newAry;
  12. }// End Function

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.