JSFiddle - React, Tailwind, and code Playground

JavaScript

month = 'july'; //global variable

function foo(){
    var month = "august"; //private
    window.season = 'summer'; //global    
    console.log(month);
};


console.log(month); //in the global scope, month = july

foo(); //in the local scope of the foo function, month = august

console.log(season); //in the global scope, season = summer