I think you're confusing a few concepts here. Let's take this quote from the MDN:
Every object descended from
Object
inherits thehasOwnProperty
method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike thein
operator, this method does not check down the object's prototype chain.
So that's the key here. When you use new
JavaScript will assign a brand new object to this
and return it, that's what an instance is. Any property declared inside the constructor is an own property. Properties declared on the prototype
are not, since they are shared with other instances of the same object.
And a prototype
is also an Object
, for example:
Bob.prototype.hasOwnProperty("sayHello"); //=> true
myBob.constructor.prototype.hasOwnProperty("sayHello"); //=> true