Explanation
Constructor Function
function Parent(firstName, lastName, gender, age, birthday, isMarried, occupation) {
Person.call(this, firstName, lastName, gender, age, birthday);
this.isMarried = isMarried;
this.occupation = occupation;
}Prototype
Parent.prototype = Object.create(Person.prototype);
Parent.prototype.constructor = Parent;Job Function
Displaying the Results
Last updated