It's important to understand that there is a distinction between an object's prototype (which is available via
Object.getPrototypeOf(obj)
, or via the deprecated__proto__
property) and theprototype
property on constructor functions. The former is the property on each instance, and the latter is the property on the constructor. That is,Object.getPrototypeOf(new Foobar())
refers to the same object asFoobar.prototype
.
Reference: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes