JSFiddle - React, Tailwind, and code Playground

by ThiefMaster

JavaScript

function test1() {
    foo_in_1();
    function foo_in_1() { alert('foo 1'); }
}

function test2() {
    foo_in_2();
    var foo_in_2 = function() { alert('foo 2'); }   
}

function test3() {
    var foo_in_3 = function() { alert('foo 3'); }   
    foo_in_3();
}


try {
    test1();
} catch(e) { alert(e) }
try {
    test2();
} catch(e) { alert(e) }
try {
    test3();
} catch(e) { alert(e) }