Standard built-ins

SharedArrayBuffer()

Try the free JavaScript compiler

Allocates shared byte storage for typed-array views; availability depends on the host and security context.

Formal Syntax & Structure

javascript syntaxjavascript
new SharedArrayBuffer(byteLength)

Parameters & Attributes

NameTypeDescription
byteLengthnumberInitial shared byte length.

Return Value

SharedArrayBuffer

Allocates shared byte storage for typed-array views; availability depends on the host and security context.

Working Example

Example Snippetjavascript
(async () => {const b=new SharedArrayBuffer(4);const a=new Int32Array(b),c=new Int32Array(b);a[0]=6;console.log(c[0],b.byteLength);})()
JavaScript Reference