Atomics.load(typedArray, index) reads the element at index and returns it. On a single thread that looks just like typedArray[index]. The difference shows up with shared memory, memory that several threads can see at the same time: an atomic load always returns a whole value that some thread really wrote, and it is ordered with the other Atomics calls, so a value written with Atomics.store() in one worker is seen correctly in another. Use load() whenever you read a slot that another thread may be changing.
Remember
Atomics.load(typedArray, index) -> current value
reads one element, changes nothing
pair it with Atomics.store() for writes
Uint8Array view -> 0 .. 255
Int8Array view -> -128 .. 127 (same bytes, other meaning)
Syntax
load() needs only the array and the position.
JavaScript
Atomics.load(typedArray, index)
Call
What it does
Atomics.load(typedArray, index)
Returns the element at index as one atomic read. The array is not changed.
Atomics.load(bigArray, index)
On BigInt64Array and BigUint64Array the result is a BigInt, for example 5n.
Available since ES2017. It is the reading half of the pair Atomics.load() / Atomics.store().
Library declarations
JavaScript
Atomics.load(typedArray, index) // returns the element value
// typedArray: Int8Array, Uint8Array, Int16Array, Uint16Array,
// Int32Array, Uint32Array, BigInt64Array, BigUint64Array
// index: 0 .. typedArray.length - 1, otherwise RangeError
Parameters
Parameter
Description
typedArray
Required. Any integer typed array, backed by a SharedArrayBuffer or a normal ArrayBuffer. A Float64Array, Float32Array, Uint8ClampedArray, or plain array throws a TypeError.
index
Required. The position to read. Unlike typedArray[99], which quietly gives undefined, an invalid index throws a RangeError.
Return Value
Return Value
Description
Number
The current element value for the 8-, 16-, and 32-bit arrays.
BigInt
The current element value for BigInt64Array and BigUint64Array.
JavaScript Examples
Example 1 — Read a Progress Slot
A worker would write its progress percentage into slot 0. The page reads it with load(). Slot 1 was never written, so it is still 0.
Brackets stay silent.slots[5] is outside the 2-element array and simply gives undefined.
load() refuses bad positions. The same index throws a RangeError, which helps you spot bugs early.
Floats are not allowed. Atomics only works on integer typed arrays, so a Float64Array throws a TypeError.
Compatibility
Browser & Runtime Support
Atomics.load() is part of ES2017 and works on shared and normal integer typed arrays in modern engines.
✓ Baseline · ES2017
Atomics.load()
Supported in all modern browsers and in Node.js, Deno, and Bun.
95%Modern browser support
Google ChromeModern versions · Desktop & Mobile
Full support
Mozilla FirefoxModern versions · Desktop & Mobile
Full support
Apple SafariModern versions · macOS & iOS
Full support
Microsoft EdgeModern versions · Chromium
Full support
OperaModern versions
Full support
Samsung InternetModern versions · Android
Full support
Internet ExplorerNo Atomics object
Not supported
Node.jsCurrent releases · checked on Node 24
Supported
DenoCurrent releases
Supported
BunCurrent releases
Supported
Atomics.load()Excellent
Bottom line: Safe everywhere. Its real job, reading memory that another thread writes, needs SharedArrayBuffer, and browsers only offer that on cross-origin isolated pages.
Frequently Asked Questions
On one thread they return the same number. With shared memory, Atomics.load() guarantees a complete value and keeps the order of other atomic operations, while a[i] does not. Atomics.load() also throws a RangeError for a bad index instead of returning undefined.
No. It only reads one element. All the other Atomics methods except isLockFree() and pause() can write.
A Number for the 8-, 16-, and 32-bit integer arrays and a BigInt for BigInt64Array and BigUint64Array.
Whenever a value is written by one thread and read by another, for example a progress counter or a ready flag in a SharedArrayBuffer used by a Web Worker.
No. Atomics works only on integer typed arrays. For floats, store a scaled integer (for example cents instead of dollars) in an Int32Array.