The global object provides variables and functions that are available anywhere. By default, those that are built into the language or the environment. In a browser it is named window , for Node.js it is global , for other environments it may have another name.

535

JavaScript - Global Variable in JavaScript A Global variable is a variable that is declared in the global scope, making it a property of the global object. Global variables are accessible from all other (local) scopes. The global scope is a scope that contains every variable declared outside of a function (functions create their own scope