深拷贝
function deepClone(source){ var targetObj = Array.isArray(source) === Array ? [] : {}; for(var keys in source){ if(source.hasOwnProperty(keys)){ if(source[keys] && typeof source[keys] === 'object'){ targetObj[keys] = deepClone(source[keys]) }else{ targetObj[keys]=source[keys] } } } return targetObj }