数组的复制

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

var arr= [1,2, 3];
var arr2 = arr.clone();
console.log(arr2); // [1, 2, 3]

原文地址:https://www.cnblogs.com/ax-null/p/6838996.html