Hi campers, in object oriented programming (OOP) challenges ,FCC explains what is prototype and every thing about it ,and untill now what I know is that when you don’t want to repeat properties that are common between a lot of objects and that they will just be repeated for no sense ,you add it to the prototype Object constructor that is inside the function constructor like this ,
function Dog (name){
this.name=name;
}
Dog.prototype.numLegs=4; // here every object instance will inherit this property .
let dogOne= new Dog("linda");
my question is about the prototype has another prototype because it is an object ,this is called prototype chain . but when we want to access the second prototype we access it like this :
function Bird(name) {
this.name = name;
}
typeof Bird.prototype; // => object
Object.prototype.isPrototypeOf(Bird.prototype); //why here we access it by Object.prototype
// returns true
why we can not access it like this :
Bird.prototype.prototype without using Object.
and thank you in advance.
. In this case the constructor of the second one in the chain is