//遍历
function deepClone(oldObj, newObj) {
var obj = newObj || {};
for(var i in oldObj) {
if(typeof oldObj[i] === 'object' && Object.prototype.toString.call(oldObj[i]) != '[object Null]') {
obj[i] = oldObj[i].constructor === Array ? [] : {};
deepClone(oldObj[i], obj[i])
} else {
obj[i] = oldObj[i]
}
}
return obj;
}
// JSON.stringify JSON.parse
JSON.parse(JSON.stringify(obj))//object->string->object