Grasping prototypical Inheritance through pseudoclassical instantiation (JavaScript)
问题 I am attempting to pass a test suite utilizing inheritance through JavaScript. Below is a snippet of the code I have so far: var Infant = function() { this.age = 0; this.color = \'pink\'; this.food = \'milk\'; }; Infant.prototype.eat = function(){ return this.eat; } var Adolescent = function() { this.age = 5; this.height = \'short\'; this.job = \'keep on growing\'; }; I would like to inherit the food property from the Infant class and the eat method but my attempts have fallen short. my