JSFiddle - React, Tailwind, and code Playground
by bilbobaggins
JavaScript
var a = 1;
four();
function four() {
if (true) {
var a = 4;
}
// alerts '4', not the global value of '1'
console.log(a);
}
by bilbobaggins
var a = 1;
four();
function four() {
if (true) {
var a = 4;
}
// alerts '4', not the global value of '1'
console.log(a);
}