Variables and functions declared in the global scope are accessible from anywhere in your JavaScript code, both within and outside of functions.
Global variables are declared outside of any function, typically at the top level of a JavaScript file or within a script tag in an HTML document.
Functions declared in the global scope are also accessible from anywhere.