function deepCopy(obj){
if(typeof obj === 'object'){
if(obj === null){
return null;
}
if(Array.isArray(obj)){
const newArr = [];
for(let i=0;i<obj.length;i++){
const item = deepCopy(obj[i]);
newArr.push(item);
}
return newArr;
}
const keys = Object.keys(obj);
const tempObj = {};
for(let key of keys){
const v = obj[key];
tempObj[key] = deepCopy(v);
}
return tempObj;
}else{
return obj;
}
};