JSFiddle - React, Tailwind, and code Playground

JavaScript

function a() {}
function b() {}

a.prototype.func = function() {
    alert(this.value);
};

inherit(b, a);

var bInst = new b;

bInst.value = 123;
bInst.func();

alert(bInst instanceof b);
alert(bInst instanceof a);
alert(bInst.constructor);

function inherit(what, from) {
    what.prototype = new from;
    what.prototype.constructor = what;
}