function Plant(){ this.country = "india"; this.isOrganic = true; } // end Plant constructor function Fruit(name){ this.name = name; this.whereItGrows = function() { console.log("it grows in " + this.country); }; } // end fruit constructor Plant.prototype.amIhealthy = function() { console.log("I am super healthy"); }; Fruit.prototype = new Plant(); // make Plant prototype for Fruit var banana = new Fruit("banana"); console.log(banana.country); console.log(banana.name); banana.whereItGrows(); banana.amIhealthy();