JSFiddle - React, Tailwind, and code Playground

by Lewis Lane

JavaScript

test1(); // works fine
test2(); // causes an error

// This function is accessible before it's defined
function test1() {
    $("body").append("Test 1");
}

// This function is not accessible until after it's defined
var test2 = function() {
    $("body").append("Test 2");
}