JSFiddle - React, Tailwind, and code Playground

JavaScript

function test(elem, opt){
   this.opt = opt;
   this.elem = $(elem);
   this.method1();
}

test.prototype.method1 = function() {
   var output = 1;
   output = this.method2(output);
   console.log(output);
}

test.prototype.method2 = function(output) {
   output += 1;
   return output;
}

var inst = new test();