When function object is used as constructor then proper prototype chain is maintained as marked in point 1 and point 2.
But as shown in following code new instances prototypes are skipping Function.prototype and directly inheriting from Object.prototype. Is there specific reason for that?
Function.prototype.extraFun = function(){console.log('funny function')};
function Thing(name){
this.name = name;
}
Thing.prototype.specs = function(){
return `name: ${this.name}`;
}
var table = new Thing('wooden table');
table.__proto__ == Thing.prototype //true [OK] (1)
Thing.__proto__ == Function.prototype //true [OK] (2)
//it should show follow the above rythm
Function.__proto__ == Object.prototype //false (A)
//why
Function.__proto__ == Object.__proto__ //true (B)
//it should be false
table.__proto__.__proto__ == Object.prototype // true (3)
//it should be true because function object is instance of Function NOT Object directly
table.__proto__.__proto__ == Function.prototype //false (4)
But issue is why point 3 is true and point 4 is false. Further more Point A and B are deviate from normal order unlike point 1 and 2