1
2
3
4
5
6
7
8
9
10
11
function deepCopy(source){
var result = {};
for(var key in source){
if(typeof source[key] === "object"){
result[key] = deepCopy(source[key])
}else{
result[key] = source[key]
}
}
return result;
}