2020
10-10
10-10
JavaScript常用工具函数库汇总
对象或数组的深拷贝/***对象或数组的深拷贝*@param{*}cloneObj被克隆的对象*@param{*}targetObj克隆的目标对象*@param{*}isOverride若属性重复,是否覆盖被克隆对象的属性*/functiondeepClone(cloneObj,targetObj,isOverride=true){const_toString=Object.prototype.toStringif(_toString.call(cloneObj)!=='[objectArray]'&&_toString.call(cloneObj)!=='[objectObject]'){returnclone...
继续阅读 >