标签:copy for this item 拷贝 对象 typeof source ceo
objDeepCopy: (source) => {
var sourceCopy = source instanceof Array ? [] : {};
for (var item in source) {
if(typeof source[item] === ‘object‘) {
sourceCopy[item] = this.a.objDeepCopy ? this.a.objDeepCopy(source[item]) :(this.a.dp && this.a.dp.objDeepCopy)? this.a.dp.objDeepCopy(source[item]):
this.b.objDeepCopy ? this.b.objDeepCopy(source[item]) :(this.b.dp && this.b.dp.objDeepCopy) ? this.b.dp.objDeepCopy(source[item]):source[item]
}else{
sourceCopy[item] = source[item]
}
}
return sourceCopy
}
标签:copy for this item 拷贝 对象 typeof source ceo
原文地址:https://www.cnblogs.com/zhaoxiaobei/p/10142204.html