对象的深拷贝
function deepCopy(data){
if(data instanceof Array){
let ary=[];
for(let i=0;i<data.length;i++){
ary[i]=deepCopy(data[i]);
}
return ary;
}else if(data instanceof Object){
let obj={};
for(let attr in data){
obj[attr]=deepCopy(data[attr]);
}
return obj;
}else{
return data;
}
}