Retrieves the global object in the current environment.
This function attempts to return the global object by checking various known global identifiers such as globalThis, self, window, and global. If none of these are defined, it throws an error.
globalThis
self
window
global
Optional
The environment object to check for global identifiers.
The global object of the current environment.
If no global object is found.
Retrieves the global object in the current environment.
This function attempts to return the global object by checking various known global identifiers such as
globalThis
,self
,window
, andglobal
. If none of these are defined, it throws an error.