suppose i have this
var x={}; //x is an address in the memory where object is stored
var z=x; //z=x after execution is equal to z={} right?
now z has nothing to do with x or not related to x after execution so when,
x={name:"Maizere"};
z!=x //true
but, when
x.name="maizere";
alert(z.name)//maizere why?
we are not setting the value of z but x and z relation to x shouldn't exit anymore
actual code:
x={};
y=x;
x.name="maizere";
alert(y.name)//maizere
I really have no knowledge of how this is working .Can anyone explain this in detail please?
alert(z.name) -> undefined... you missed something.undefined. Please show us your exact code, and use comments properly.