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

The Atomics.store() static method stores a given value at the given position in the array and returns that value.

Syntax

Atomics.store(typedArray, index, value)

Parameters

Return value

The value that has been stored.

Exceptions

Examples

Using store()

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

Atomics.store(ta, 0, 12); // 12

Specifications

Browser compatibility

See also