JSFiddle - React, Tailwind, and code Playground
JavaScript
function Human() {
}
function Engineer(diploma) {
this.diploma = diploma;
}
Engineer.prototype = Human.prototype;// Line B1
Engineer.prototype.constructor = Engineer;
Engineer.prototype.getDiploma = function() {
alert(this.diploma);
};
var engineer = new Engineer("Bridges and Roads");
engineer.getDiploma();
var human = new Human();
human.getDiploma(); // Line B2