多维数组深拷贝
使用递归进行深拷贝
var arr = [55, 66, [99, 66], 100];
function deepCopy (array) {
var temp = [];
array.forEach(function(value, index){
if(Array.isArray(value)){
temp.push(deepCopy(value));
}else{
temp.push(value);
}
})
return temp;
}
var result = deepCopy(arr);
console.log(result)