JSFiddle - React, Tailwind, and code Playground

JavaScript

var Class = function () {
    var slice = Array.prototype.slice;
    var bind = Function.prototype.bind;

    var prototype = Class.prototype = new Function;
    return prototype.constructor = Class;

    function Class(definition, base) {
        var klass = function () {
            var instance = this;

            if (base instanceof Class)

            var uber = function () {
                if (uber instanceof base) return uber;

                arguments = slice.call(arguments);
                arguments = [null].concat(arguments);
                uber = bind.apply(base, arguments);
                uber = new uber;

                var hyper = instance.__proto__ = uber;
                var proto = hyper.__proto__;

                while (proto != parent) {
                    hyper = proto;
                    proto = hyper.__proto__;
                }

                hyper.__proto__ = child;

                return uber;
            };

            var constructor = definition.call(this, uber);
            constructor.apply(this, arguments);
        };

        if (base instanceof Class) {
            klass.__proto__ = base;
            var child = klass.prototype;
            var parent = child.__proto__ = base.prototype;
        } else klass.__proto__ = prototype;

        return klass;
    }
}();

var Rectangle = new Class(function () {
    var width;
    var height;

    function constructor(length, breadth) {
        width = length;
        height = breadth;
    }

    this.area = function () {
        return width * height;
    };

    return constructor;
});

var Square = new Class(function (uber) {
    return function (side) {
        uber(side, side);
    };
}, Rectangle);

var Cube = new Class(function (uber) {
    var side;

    function constructor() {
        side = arguments[0];
        uber = uber(side);
    }

    this.area = function () {
        return 6 * uber.area();
    };

    this.volume = function () {
        return side *...