3_object_links.js 543 B

123456789101112131415161718192021222324252627282930313233
  1. var notebook = {
  2. brand: "HP",
  3. type: "440 G4",
  4. model: "Y7Z75EA",
  5. ram: 4,
  6. size: "14",
  7. weight: 1.8,
  8. resolution: {
  9. width: 1920,
  10. height: 1080,
  11. },
  12. };
  13. var phone = {
  14. brand: "meizu",
  15. model: "m2",
  16. ram: 2,
  17. color: "black",
  18. };
  19. var person = {
  20. name: "Donald",
  21. surname: "Trump",
  22. married: true,
  23. }
  24. person.smartphone = phone;
  25. person.laptop = notebook;
  26. person.smartphone.owner = person;
  27. person.laptop.owner = person;
  28. console.log(person.smartphone.owner.laptop.owner.smartphone == person.smartphone) // true