global

  • global object contains:
    • JSON
    • setInterval
    • types like Boolean, Array, Number, Date, Function etc.
    • File
  • You can call the properties of global object directly without mentioning global
  • It is similar to BOM (Browser Object Model) window in browser runtime
  • Properties of global:
for (v of Object.getOwnPropertyNames(global)) {
	console.log(v);
}
 
/** [[Output]]
 
Object
Function
Array
Number
parseFloat
parseInt
Infinity
NaN
undefined
Boolean
String
Symbol
Date
Promise
RegExp
Error
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
globalThis
JSON
Math
console
Intl
ArrayBuffer
Uint8Array
Int8Array
Uint16Array
Int16Array
Uint32Array
Int32Array
Float32Array
Float64Array
Uint8ClampedArray
BigUint64Array
BigInt64Array
DataView
Map
BigInt
Set
WeakMap
WeakSet
Proxy
Reflect
decodeURI
decodeURIComponent
encodeURI
encodeURIComponent
escape
unescape
eval
isFinite
isNaN
SharedArrayBuffer
Atomics
FinalizationRegistry
WeakRef
WebAssembly
global
process
Buffer
URL
URLSearchParams
TextEncoder
TextDecoder
clearInterval
clearTimeout
setInterval
setTimeout
queueMicrotask
clearImmediate
setImmediate
$jsDebugIsRegistered
 
**/