You can not.
foo1 was created with the original Foo.prototype object, which has a constructor reference to Foo , which it inherits.
In contrast, foo2 inherits from the empty object that you set Foo.prototype before creating it. And this object inherits its constructor property from Object.prototype , so foo2.constructor === Object .
Bergi source share