Home Tutorialhelp Comment You would obtain the same with splice

 
 

Comment

Hasse
You would obtain the same with splice,
April 27, 2010 at 7:53 PM

Array.prototype.clone = function() {
return this.splice(0);
}

Except that not all objects have a clone method, so actually I think the use of splice might be less error prone :)
View All Comments
Advertisement
Related Tutorial and Articles
Advertisements Advertisements
 

 

 

DMCA.com