A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Glossary/Global_object below:

Global object - Glossary | MDN

Global object

The global object in JavaScript is an object which represents the global scope.

Note: Globally available objects, which are objects in the global scope, are sometimes also referred to as global objects, but strictly speaking, there is only one global object per environment.

In each JavaScript environment, there's always a global object defined. The global object's interface depends on the execution context in which the script is running. For example:

The globalThis global property allows one to access the global object regardless of the current environment.

var statements and function declarations at the top level of a script create properties of the global object. On the other hand, let and const declarations never create properties of the global object.

The properties of the global object are automatically added to the global scope.

In JavaScript, the global object always holds a reference to itself:

console.log(globalThis === globalThis.globalThis); // true (everywhere)
console.log(window === window.window); // true (in a browser)
console.log(self === self.self); // true (in a browser or a Web Worker)
console.log(frames === frames.frames); // true (in a browser)
console.log(global === global.global); // true (in Node.js)
See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4