I have objects A and B and would like pass properties of A into B by reference, without passing B’s props into A. I.e.:
const A = { d: 1, e: 2 };
const B = { f: 10, g: 20 };
const C = Object.assign(A, B);
A.d = 10;
console.log(C); // { d: 10, e: 2, f: 10, g: 20} as desired
console.log(A); // { d: 10, e: 2, f: 10, g: 20} but would like just { d: 10, e: 2 }
Is there a way to do this, without using functions/getters to copy things?