const a = {x: "Hi", y: "Test"} const b = ??? // b = {x: "Bye", y: "Test"} // a = {x: "Hi", y: "Test"}
there's an easy way to change object property without mutating the original object.
const a = {x: "Hi", y: "Test"}; const b = {...a, y: "hello"};