JSFiddle - React, Tailwind, and code Playground
JavaScript
function test(elem, opt){
this.opt = opt;
this.elem = $(elem);
this.method1();
}
test.prototype.method1 = function() {
this.output = 1;
this.method2(this.output);
console.log(this.output);
}
test.prototype.method2 = function(output) {
this.output += 1;
}
var inst = new test();