
function deepCopy(target){
const copy = {};
for(let key in target){
if(typeof target[key] === 'object'){
copy[key] = deepCopy(target[key])
} else {
copy[key] = target[key];
}
}
return copy;
}
本文使用 mdnice 排版

function deepCopy(target){
const copy = {};
for(let key in target){
if(typeof target[key] === 'object'){
copy[key] = deepCopy(target[key])
} else {
copy[key] = target[key];
}
}
return copy;
}
本文使用 mdnice 排版