If you assign a property to an Object, can you make it changes as the object changes?

Viewed 55

I was testing with the basic with the below code

var A={};
var B={name:"come"};
A.pro=B;
B=null;
//Here A.pro is still point to normal B, not to a null

How should I do this if I want when B changes, A.pro will also change?

2 Answers
Related