JavaScript: the Global Object
JavaScript the language defines a global object.
Purpose of Global Object
Global object holds all variable/object/function of the JavaScript language as properties.
Value of Global Object
What object is the Global Object depends on the language host.
In web browser, the Global Object is window
.
[see Browser Window Object]
In Deno, the Global Object is window
.
In node.js, the Global Object is global
.
[see Node.js Tutorial]
globalThis
globalThis
(JS2020)
is a variable that is alias to
the Global Object.
console.log( globalThis === window); // true in browser
Constant Literals
Simple Functions
eval
isFinite
- isNaN
- parseInt
- parseFloat
- encodeURI /
decodeURI
- encodeURIComponent /
decodeURIComponent
- escape /
unescape
Static Objects
Primitive Wrapper
Special Objects
Error Objects
Error
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
Misc
DataView
ArrayBuffer
Float32Array
Float64Array
Int8Array
Int16Array
Int32Array
Uint8Array
Uint8ClampedArray
Uint16Array
Uint32Array