Hi I have a simple doubt that is in prototype chain we go from top to bottom then why its visual representation is from bottom to top
As depticted here:
function Fn() {}
var obj = new Fn();
console.log(obj.__proto__ === Fn.prototype);
// -> true
console.log(obj.__proto__.__proto__=== Object.prototype);
// -> true
console.log(obj.__proto__.__proto__.__proto__ === null);
// -> true
Visual representation:
__proto__ === null
|
|
__proto__ === Object.prototype
|
|
__proto__ === Fn.prototype
|
|
obj
Why it is from bottom to top?