global scope js

JavaScript
window.myGlobalVariable = "I am totally a global Var"; //define a global variable
var myOtherGlobalVariable="I too am global as long as I'm outside a function";const color = 'blue'

const returnSkyColor = () => {
  return color; // blue 
};

console.log(returnSkyColor()); // bluevar showState = function() {
  console.log("Idle");
};

function showState() {
  console.log("Ready");
} 

showState();            // output: Idle
Source

Also in JavaScript: