Consider the following code:
A={
prop1: 12,
prop2: {x:12}
};
newprop2={k:55,l:3};
A.prop2=newprop2;
newprop2 = {m:65, n:25};
console.log(A);
Output is:
{ prop1: 12, prop2: { k: 55, l: 3 } }
I expected the output to be:
{ prop1: 12, prop2: {m:65, n:25} }
Because objects are copied by reference, I was hoping that sub-properties were copied by reference because the objects I want to assign as values are LARGE and do not want to maintain multiple copies.