JSFiddle - React, Tailwind, and code Playground
JavaScript
var x = 'Outer Scope';
alert(x);
(function(){
// Won't affect outer scope since x is local in this function
var x = 'Inner Scope';
alert(x);
})();
alert(x);
var x = 'Outer Scope';
alert(x);
(function(){
// Won't affect outer scope since x is local in this function
var x = 'Inner Scope';
alert(x);
})();
alert(x);