JSFiddle - React, Tailwind, and code Playground

JavaScript

function test() {
 // foo(); // typeerror "foo is not a function"
  bar(); // this will run
  
  var foo = function () {
    alert("this won't run");
  }
  function bar() {
    alert("this will run");
  }
}

test();