Prototype chain là đường JavaScript đi tìm thuộc tính.
Nếu obj.name không có trên obj, JS tìm tiếp trên prototype... cho tới khi gặp null thì dừng.
javascript
const animal = { breathes: true };
const dog = Object.create(animal);
dog.bark = true;
console.log(dog.bark); // true — own property
console.log(dog.breathes); // true — inherited from animal
console.log(dog.__proto__ === animal); // true
// hasOwnProperty kiểm tra chỉ own property:
console.log(dog.hasOwnProperty('breathes')); // false