Passing Objects
When we copy an object or pass an object to a function, it is often passed a reference to that object. So we make any changes to the object's references, which in effect will affect the original object of the reference.
var she = {num:1}; var her =// 1her.num =+//
The same is true for passing objects to functions:
var she = {num:1}; var function (o) {o.num=100= 100;
Compare Objects
When we compare objects , the result is true when and only if two references point to the same object. The comparison also returns False if the object is different but happens to have the same property as the method.
var a = {num:1}; var b = {num:1// false/ / false
We can create a new object and assign one of the objects to her so that this variable points to the object
var c =// true
In this case, C is the same as the object A is pointing to (that is, one of the other changes as well);
But B and C are different objects:
// false
On JavaScript Objects (iii)---pass/compare objects