JSFiddle - React, Tailwind, and code Playground

JavaScript

console.log('fn1 created');

function fn1(){
    console.log('fn1 called');
    console.log('fn2 created');

    fn2();
    fn2();
    
    function fn2(){
        console.log('fn2 called');
    }
}

fn1();
fn1();