Looking at the answer to (How does the prototype chain work?) I can see that there is an inheritance chain. What is happening behind the scenes?
As far as I can tell the prototype property stores a reference to the prototype object? Why does that object not include the prototype's prototype and how is it maintaining that reference instead?
var Parent = function() {
this.name = 'Parent';
}
Parent.prototype.sayHi = function() {
console.log('hi');
}
var Child = function() {
this.name = "Child";
}
Child.prototype = new Parent();
console.log(Parent.prototype); // { sayHi: [Function] }
console.log(Child.prototype); // { name: 'Parent' }
console.log(Child.prototype.prototype); // undefined
=============== Answer from below ===============
console.log(Parent.prototype); // { sayHi: [Function] }
console.log(Child.prototype); // { name: 'Parent' }
console.log(Child.prototype.__proto__); // { sayHi: [Function] }