function Parent(){
this.name = "parent";
console.log("this gets executed");
}
function Child(){
Parent.call(this) // doesnt the this here belongs to the child object?
}
var o = new Child();
Why does the this
inside the child object invokes the parent constructor?
Doesnt the this
refer to the child object?
Please enlighten the noob javascripter thanks!