I am wondering why in this piece of code, when I am trying to access the properties of the object that the garfield is made of, in this case Cat, I am getting undefined:
function Cat(){
this.legs = 2;
this.species = 'cat';
};
Cat.prototype.makeSound = function() {
console.log(this.sound); // logs undefined
};
const garfield = Object.create(Cat);
garfield.sound = 'feed me';
garfield.makeSound();
console.log(garfield.legs) // logs undefined
Shouldn't I be able to get down the prototype inheritance chain the access to those properties?