JSFiddle - React, Tailwind, and code Playground
JavaScript
function GeneralClass (a, b, c) {
this.a = a;
this.b = b;
this.c = c;
}
GeneralClass.prototype.hello = function () {
console.log("hello");
console.log(this.a);
console.log(this.b);
console.log(this.c);
}
var g = new GeneralClass(1, 2, 3);
g.hello();
function SpecificClass (b) {
this.a = 1;
this.b = b;
this.c = 3;
}
SpecificClass.prototype = new GeneralClass();
SpecificClass.prototype.bye = function () {
console.log("bye");
console.log(this.b);
}
var s = new SpecificClass(22);
s.hello();
s.bye();