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 () {
    // width and height are private variables
    var width;
    var height;

    // the class constructor accepts two arguments
    function constructor(length, breadth) {
        // save the parameters
        width = length;
        height = breadth;
    }

    // area is a public function
    this.area = function () {
        // return the area of the rectangle
        return width * height;
    };

    return constructor; // always remember to return the constructor
});

// notice that the class definition function accepts a parameter called uber
var Square = new Class(function (uber) {
    // return the...