const a = { x: 0, y: { z: 0 } }; const b = JSON.parse(JSON.stringify(a)); b.y.z = 1; // doesn't update a.y.z