CatWithWings
Results
2
comments of
CatWithWings
深度优先算法深拷贝有很多就不写了 广度优先算法深拷贝,实现了下,暂时没发现问题 ``` // 广度优先法 function deepClone(obj, tempNodes=[]) { if (obj === null) return null; if (typeof obj !== "object") return obj; if (obj.constructor === Date) return new Date(obj); const...
> > 深度优先算法深拷贝有很多就不写了 > > 广度优先算法深拷贝,实现了下,暂时没发现问题 > > ``` > > // 广度优先法 > > function deepClone(obj, tempNodes=[]) { > > if (obj === null) return null; > > if...