JSFiddle - React, Tailwind, and code Playground
JavaScript
var $a = (function(){
var innerVariable = "Hello from A";
this.show = function(){
console.log(innerVariable);
}
return this;
})();
var $b = (function(){
var innerVariable = "Hello from B";
this.show = function(){
console.log(innerVariable);
}
return this;
})();
$a.show(); // "Hello from B" - why $b.innerVariable overwrites $a.innerVariable?
$b.show(); // "Hello from B" - okay, expected and logical