Reputation: 81
Why Object.getPrototypeOf(Object) === Object.getPrototypeOf(Function)
in JavaScript?
What is the purpose of this design?
Upvotes: 5
Views: 218
Reputation: 887459
The __proto__
property of an object indicates the prototype that that object is inheriting.
Since Object
and Function
are both functions, they both have the same prototype, namely, Function.prototype
.
Upvotes: 5