JSFiddle - React, Tailwind, and code Playground
JavaScript
var tt = function () {
var hehe = '101';
}
tt.prototype = {
test: function() {
hehe = '102'; // uncomment this line to see that hehe is not defined in tt, but is defined globaly
console.log(hehe);
}
};
var ttt = new tt();
ttt.test();
console.log(hehe); // after uncommenting line hehe = '102', this will show you that hehe is in global scope