JSFiddle - React, Tailwind, and code Playground

by Dave Salomon

JavaScript

var x = function($){
  "use strict";

      var add = function(a, b){
         alert('add');
        },
        print = function(str){
         return 1;
        },
        setup = function(){
          alert('setup');
        },
        init = function(){
          alert('init');
        };

      init();
      setup();
    
    return {
          add: add,
          print: print
      };
};

var y = new x(jQuery);
console.log(y);

(function(){
    var m = y.print();
    if(m != 1){
        console.log('failed');
    } else {
        console.log('passed');
    }
})();