I want to create a new object that has properties that reference properties from other objects. I want modifying new object properties to also update the original source object properties.
const obj1 = {
a: 1,
}
const obj2 = {
b: 2,
}
const newObj = {...obj1, ...obj2};
newObj.a = 3;
// obj1.a should also be set to 3
I think this can be achieved via getters and setters, but is it possible to create get/set dynamically from property keys of another object?
Thanks!