Closed alex-80 closed 3 months ago
复现示例:
const a = { key1: [] }; const b = { key1: { key2: 1 } }; deepCompareAndModify(a, b) console.log(JSON.stringify(a) === JSON.stringify(b)) const c = { key1: {} }; const d = { key1: [{ key2: 1 }] }; deepCompareAndModify(c, d) console.log(JSON.stringify(c) === JSON.stringify(d))
期望结果: 结果都为true 实际结果: 结果都为false
非常感谢您发现了这个问题并给我提供了解决方案
复现示例:
期望结果: 结果都为true 实际结果: 结果都为false