var a = {
name : '笑話',
age : 20,
arr : [1,2,3,4,5,1,66,6,2,76]
};
var b;
var deepCopy= function(source) {
var result={};
for (var key in source) {
//遞歸調(diào)用
result[key] = typeof source[key]==='object'? deepCopy(source[key]): source[key];
}
return result;
}
b=deepCopy(a);