Is there a difference between Object.getPrototypeOf(obj) and obj.constructor.prototype? Or are these two referencing the same thing?
Is there a difference between Object.getPrototypeOf(obj) and obj.constructor.prototype ? Or are these two referencing
Share
NO
It returns the internal
[[Prototype]]value.For example:
o.constructor.prototypeonly works with objects created throughnew ConstructorFunctionor where you have manually set thePrototype.prototype.constructor === Prototyperelationship.