Here is my code:
function Dog(name) {
this.name = name;
}
let beagle = new Dog("Snoopy");
Dog.prototype.isPrototypeOf(beagle); // => true
Object.prototype.isPrototypeOf(Dog.prototype);
Based off of this i understand that Dog.prototype is the prototype of all of the objects that have been constructed by it, for instance, beagle.
Now i am saying Object.prototype is the prototype of the prototype all of those objects. This means that all JavaScript objects across all the code will share this prototype? Meaning i could store a function in it? Number of legs? How do i even edit it, Like a regular prototype?
A super-type is the object, and the created object is the subtype. Is the prototype also considered the super-type?
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain