Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 相同对象的两个引用和包含相同属性的两个不同对象是有区别的。
- var object1 = {value: 10};
- var object2 = object1;
- var object3 = {value: 10};
- object1 == object2;
- --true
- object1 == object3;
- --false
- object1.value = 15;
- object2.value;
- --15
- object3.value;
- --10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement