js 深度拷贝
function cloneObj(source, target) { var target = target || {} for (let key in source) { if (source.hasOwnProperty(key)) { if (typeof(source[key])== 'object') { target[key]=source[key] instanceof Array?[]:{} cloneObj(source[key],target[key]) } else { target[key] = source[key] } } } return target }