In typical JavaScript inheritance, we pass the Parent.prototype to Object.create.
function Parent() {};
function Child() {
Parent.call(this);
}
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;
var foo = new Child();
Is there a difference calling Object.create(Person) vs Object.create(Parent.prototype).
Many tutorials including the MDN article linked below pass "Parent.prototype" instead of just "Parent".
As per MDN definition "The Object.create() method creates a new object, using an existing object as the prototype of the newly created object."
I tried both ways and console.log shows the same result with both approaches.
A similar question was answered here but doesn't clarify this difference.
var o = Object.create(Object.prototype); // same as var o = {};