JSFiddle - React, Tailwind, and code Playground

by lbstr

JavaScript

function main(){
    var callMom = function(){ 
        alert('hi mom!');
    }

    return {
        callMommy: callMom
    };
}

function goAboutYourDay(){
    brushYourTeeth(); // still works
    var m = main(); // now main returns something
    m.callMommy(); // use it!
}

function brushYourTeeth(){
    alert('brush brush brush');
}

goAboutYourDay();