Standard built-ins
SharedArrayBuffer()
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
| Name | Type | Description |
|---|---|---|
| byteLength | number | Initial 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);})()