# Globals

Azion Runtime gives every function a set of global names that the code uses without an import: JavaScript built-ins, Web APIs, the Azion APIs, and some Node.js globals. The lists on this page are the names the deployed runtime exposes, grouped by the type `typeof` returns for each. `self` and `globalThis` are the same object.

> **Note**
>
> Under `azion dev`, `caches`, `upgradeWebSocket`, `WebSocket`, and `CustomEvent` are not defined, and `globalThis.dispatchEvent` is not a function. `queueMicrotask` is defined locally but not deployed. `EdgeRuntime` holds `"edge-runtime"`, and `Date.now()` advances during a request.

---

## Constructors and functions

These globals are functions, so `typeof` returns `function` for each of them:

- Object
- Function
- Array
- Number
- parseFloat
- parseInt
- Boolean
- String
- Symbol
- Date
- Promise
- RegExp
- Error
- AggregateError
- EvalError
- RangeError
- ReferenceError
- SyntaxError
- TypeError
- URIError
- ArrayBuffer
- Uint8Array
- Int8Array
- Uint16Array
- Int16Array
- Uint32Array
- Int32Array
- Float32Array
- Float64Array
- Uint8ClampedArray
- BigUint64Array
- BigInt64Array
- DataView
- Map
- BigInt
- Set
- WeakMap
- WeakSet
- Proxy
- decodeURI
- decodeURIComponent
- encodeURI
- encodeURIComponent
- escape
- unescape
- isFinite
- isNaN
- Event
- EventTarget
- CustomEvent
- dispatchEvent
- addEventListener
- removeEventListener
- AbortSignal
- AbortController
- Blob
- Buffer: the Node.js `Buffer` class. For more information, refer to [node:buffer](/en/documentation/devtools/runtime/node/buffer/).
- Cache and CacheStorage: the classes of the [Cache API](/en/documentation/devtools/runtime/api-reference/cache/).
- Crypto
- CryptoKey
- CountQueuingStrategy
- DOMException
- FormData
- Headers
- ReadableStream
- ReadableStreamBYOBReader
- ReadableStreamDefaultReader
- Request
- Response
- SubtleCrypto
- TextDecoder
- TextEncoder
- TransformStream
- URL
- URLPattern
- URLSearchParams
- WritableStream
- WritableStreamDefaultWriter
- atob
- btoa
- clearTimeout
- fetch
- setTimeout
- setInterval
- setImmediate
- clearImmediate
- structuredClone
- ExtendableEvent
- FetchEvent
- FirewallEvent
- clearInterval
- SharedArrayBuffer
- CompressionStream
- DecompressionStream
- TextDecoderStream
- TextEncoderStream
- upgradeWebSocket and WebSocket: the functions of the [WebSocket](/en/documentation/devtools/runtime/api-reference/websocket/) API.

`globalThis` is an `EventTarget`, so the global `addEventListener`, `removeEventListener`, and `dispatchEvent` act on it.

`ExtendableEvent`, `FetchEvent`, and `FirewallEvent` are defined, but a function cannot construct them: `new FetchEvent('fetch')` throws `TypeError: Illegal constructor.` The runtime creates the `FetchEvent` that a `fetch` listener receives from [addEventListener](/en/documentation/devtools/runtime/api-reference/add-eventlistener/).

---

## Objects

These globals are objects, so `typeof` returns `object` for each of them:

- globalThis
- JSON
- Math
- Intl
- Reflect
- console
- crypto
- self
- Atomics
- WebAssembly
- performance
- caches: the `CacheStorage` instance of the [Cache API](/en/documentation/devtools/runtime/api-reference/cache/).
- process: the Node.js `process` object. Its `process.env` holds the environment variables of the account. For more information, refer to [node:process](/en/documentation/devtools/runtime/node/process/).
- Azion: the namespace of the Azion APIs, which reach [environment variables](/en/documentation/devtools/runtime/api-reference/environment-variables/), [network lists](/en/documentation/devtools/runtime/api-reference/network-list/), [Object Storage](/en/documentation/devtools/runtime/api-reference/storage/), [SQL Database](/en/documentation/devtools/runtime/api-reference/sql-database/), [KV Store](/en/documentation/devtools/runtime/api-reference/kv-store/), and [AI Inference](/en/documentation/devtools/runtime/api-reference/ai/).

---

## Numeric values

These globals are numbers:

- Infinity
- NaN

---

## Other values

| Global        | Type        | Value       |
| ------------- | ----------- | ----------- |
| `undefined`   | `undefined` | `undefined` |
| `EdgeRuntime` | String      | `"azion"`   |

---

## Time inside a request

In a deployed function, `Date.now()` returns the same value for the whole request. It does not advance across a loop, a timer, or a `fetch()` call, and its milliseconds read `0`. To measure elapsed time inside a request, use `performance.now()`: it advances during the request and starts at `0`.

---

## Related resources

- [Web APIs](/en/documentation/devtools/runtime/api-reference/javascript.md): The reference pages of the Web APIs that these globals expose.
- [Web standards](/en/documentation/devtools/runtime/api-reference/web-standards.md): The standards that Azion Runtime implements, and what it refuses.
- [Node.js APIs](/en/documentation/devtools/runtime/node.md): The Node.js modules that a function imports, beside the `Buffer` and `process` globals.
- [How Azion Runtime works](/en/documentation/devtools/runtime/how-it-works.md): How the deployed runtime differs from `azion dev` on your machine.
