I have read a lot on how prototypal inheritance works and how the interpreter travels the prototype chain to find the property.
function Man()
{
this.hands=2;//1
}
function father()
{
this.name="";
}
father.prototype= new Man();//2
var malay= new father();
var abhik= new father();
Now my question is that statement #1 & #2 is only invoked once . So "abhik" and "malay" should both share the same Man object ? So there will be 3 objects in memory . 1.abhik 2.malay 3.man (One instance shared by both) So by that logic the changed value should be shared across objects ?
malay.hands=3;
console.log(abhik.hands);
abhik.hands=4;
console.log(malay.hands);
But it is not the case. Why so ?