Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. 相同对象的两个引用和包含相同属性的两个不同对象是有区别的。
  2. var object1 = {value: 10};
  3. var object2 = object1;
  4. var object3 = {value: 10};
  5.  
  6. object1 == object2;
  7. --true
  8. object1 == object3;
  9. --false
  10.  
  11. object1.value = 15;
  12. object2.value;
  13. --15
  14. object3.value;
  15. --10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement