Am new to client side application development, need some clarity on below mentioned issue.
I have one object var obj1={'name':'Sachin'}
I assign that object to obj2
var obj2=obj1.
Now my obj2
and obj1
objects both are same
Now by using obj2
I change the name property value like
obj2.name="Dravid";
Now my obj1
and obj2
both name property values turned to be 'Dravid' because of 'sigletone' behavior of JSON object? is it correct?
Now my question is:
if I made my obj1
is empty like
obj1={}
then why my obj2
is not turned to be empty ?
still it show obj2={'name':'Dravid'}
What is the reason behind that ?
Could please help me on this.
thanks in advance...