JSFiddle - React, Tailwind, and code Playground

JavaScript

function BaseClass() {
    var privatestuff = "blah";
    return {
        BaseMethod: function() {
            console.log('BaseMethod called');
        }
    }
}

function SubClass() {
    var moreprivates = "stuff";
    return {
        SubClassMethod: function() {
            console.log('SubClassMethod called');
        }
    }
}

SubClass.prototype = new BaseClass();
var obj = new SubClass();
obj.SubClassMethod(); // SubClassMethod called
obj.BaseMethod(); // Uncaught TypeError: undefined is not a function