JSFiddle - React, Tailwind, and code Playground
JavaScript
var outerfunc = function() {
var a = "1";
outerfunc.prototype.method = function() {
alert(a);
};
};
var test = new outerfunc();
test.method();
var outerfunc = function() {
var a = "1";
outerfunc.prototype.method = function() {
alert(a);
};
};
var test = new outerfunc();
test.method();