UNB/ CS/ David Bremner/ teaching/ cs2613/ books/ mdn/ Reference/ Global Objects/ Atomics/ Atomics.load()

The Atomics.load() static method returns a value at a given position in the array.

Syntax

Atomics.load(typedArray, index)

Parameters

Return value

The value at the given position (typedArray[index]).

Exceptions

Examples

Using load

const sab = new SharedArrayBuffer(1024);
const ta = new Uint8Array(sab);

Atomics.add(ta, 0, 12);
Atomics.load(ta, 0); // 12

Specifications

Browser compatibility

See also