JSFiddle - React, Tailwind, and code Playground

by rajeshpillai

JavaScript

function scopeDemo() {
    var a = 5;
    if (true) {
        var b = 10;
    }
    // This will work
    alert(b);
}
    
scopeDemo();