JSFiddle - React, Tailwind, and code Playground

JavaScript

month = 'july'; //global variable

function foo(){
    var month = "august"; //private
    window.season = 'summer'; //global
    weather = 'hot'; //global    
    this.activity = 'swimming' //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

console.log(weather); //in the global scope, weather = hot

console.log(activity); //in the global scope, activity = swimming