Why won't Javascript inherit the properties from a prototype
Example
function Man(name,age,color){
this.name = name;
this.age = age;
this.color = color;
}
boy = function Boy(){};
boy.prototype = new Man();
myboy = new boy('hari',14,'blue');
console.log(myboy);
// => myboy {name:undefined, age:undefined, color:undefined}
It does not inherit the properties.
Its meant to have the properties
// => myboy {name:'hari', age:14, color:'blue'}
name,ageandcolor. They just don't have any values because you are callingManwithout any arguments, andBoydoesn't do anything with the arguments you provided.Boydoesn't do anything with the arguments you provided." The function is empty.