Reputation: 105
console.log(Function.prototype.__proto__); //Object {}
Why not Object.prototype?
KFzI3
Upvotes: 0
Views: 189
Reputation: 665485
Why not
Object.prototype
?
Because objects don't have "names", and the console does not know that the object you just logged is the one that is (or can be) referred to as Object.prototype
.
Instead, it just sees that there are no enumerable properties ({}
), and that it has a .constructor
property which refers to a function whose .name
is the string Object
.
Upvotes: 0
Reputation: 119887
You can check this out in Dev tools. Go to the sources tab and under Watch Expressions section. Watch Function
and you'll see the breakdown of the prototype chain. More about it on MDN.
Upvotes: 0
Reputation: 27470
It is exactly Object.prototype.
Try this:
alert(Function.prototype.__proto__ === Object.prototype);
Upvotes: 3