On this page
Global.globalThis
Prev: queueMicrotask | Up: Global | Next: isNaN
Rel: Global, JS Core Syntax & Types
Ref: MDN Web Docs — Global.globalThis
Tags: #public #web #javascript #builtins #global #tier/standard
Signature & Overview
globalThis
Standard cross-environment reference to the global object (window in browsers, global in Node, self in Workers).
Notes & Pitfalls
- Portable global object across environments: Works identically in browsers (
window), Web Workers (self), Node.js (global), and Deno/Bun.
Example
console.assert(typeof globalThis.setTimeout === "function");
Linked from
Related notes
- tuts/javascript/builtins/Global/isNaN Linked here; links to this page; shared tags: #builtins, #global, #javascript, #tier, #web
- tuts/javascript/builtins/Global/queueMicrotask Linked here; links to this page; shared tags: #builtins, #global, #javascript, #tier, #web
- tuts/javascript/builtins/Global Linked here; links to this page; shared tags: #builtins, #global, #javascript, #web
- tuts/javascript/tutorials/core_syntax_and_types Linked here; shared tags: #javascript, #web
- tuts/javascript/builtins/Global/encodeURIComponent shared tags: #builtins, #global, #javascript, #tier, #web
- tuts/javascript/builtins/Global/Number_isNaN shared tags: #builtins, #global, #javascript, #tier, #web
- tuts/javascript/builtins/Global/parseInt shared tags: #builtins, #global, #javascript, #tier, #web
- tuts/javascript/builtins/Global/structuredClone shared tags: #builtins, #global, #javascript, #tier, #web
- tuts/javascript/builtins/Array/at shared tags: #builtins, #javascript, #tier, #web
- tuts/javascript/builtins/Array/filter shared tags: #builtins, #javascript, #tier, #web