function Parent(){ console.log(this); } function Child(){ Parent.call(this); } function ex(c,p){ const proto=Object.create(p.prototype); proto.constructor=c; c.prototype=proto; } ex(Child,Parent); const p=new Parent(); const c=new Child(); console.log(C instanceof Parent)