JSFiddle - React, Tailwind, and code Playground
HTML
<script>
var FirstClass = function() {
this.a = 1;
}
FirstClass.prototype.method_1 = function() {
return 1;
}
var SecondClass = function() {
this.b = 2;
}
SecondClass.prototype = new FirstClass();
SecondClass.prototype.constructor = SecondClass;
SecondClass.prototype.method_2 = function() {
return 2;
}
var obj = new SecondClass();
alert(obj.a);
alert(obj.method_1());
alert(obj.b);
alert(obj.method_2());
</script>