I'm taking the time to dive deeper into prototypal inheritance. I know that an instance's __proto__
property points to the constructor function's prototype
object, but where does the constructor function's __proto__
property point to?
I initially thought that since the constructor function is also an instance of Function, it would point to the Function constructor's prototype
object. However, it turns out to be an empty function.
var Example = function(){
this.attribute = 'example';
}
var exampleInstance = new Example();
exampleInstance.__proto__ === Example.prototype // true
Example.__proto__ // function() {}
[Edit] Ovidiu Dolha has now validated my understanding, so perhaps this will be beneficial for someone else.