Im trying to call Person.showInfo() from inside Professor constructor, with its name and age as a parameters. Is it possible?. Please see the comment below thanks.
var Person = function(_name, _age) {
this.name = _name;
this.age = _age;
}
Person.prototype.showInfo = function() {
console.log(this.name, this.age);
};
var Professor = function(_name, _age, _course) {
Person.call(this, _name, _age);
this.course = _course;
};
Professor.prototype = Object.create(Person.prototype);
Professor.prototype.constructor = Professor;
Professor.prototype.showInfo = function() {
// How to call Person.showInfo() here ???
// Person.prototype.showInfo() ...showing the Professor's name and age
console.log(this.course);
};