JSFiddle - React, Tailwind, and code Playground

JavaScript

var DemoA = (function($) {
    var pubs = function () {
        this.dosomething = function () {
            console.log("just executed `dosomething`");
        };
    }
    return pubs;
})(jQuery);

var a = new DemoA();
a.dosomething();