const a = {x: "Hi", y: "Test"} const b = ??? // b = {x: "Bye", y: "Test"} // a = {x: "Hi", y: "Test"}
Create a copy of the object and change the copy:
const b = Object.assign({}, a, {x: "Bye"})
Docs for Object.assign()