数组的复制

it2026-04-16  5

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

最新回复(0)