JSFiddle - React, Tailwind, and code Playground

JavaScript

var main = function(){
    console.log("foo");
    var function1 = function( string ) { 
        console.log("function1: " + string);
    };
    var function2 = function() {
        console.log( "hadouken!" );
    };
    // you will need to use a closure to call the function 
    // that you want with parameters
    // if you dont have parameters, just pass the function itself
    setTimeout(function(){ function1("bar") }, 5000);
    var x = setTimeout(function2, 6000);
    console.log(x, 'lol'');
}
setTimeout(main, 2000);