Standard built-ins

TypedArray.prototype.buffer

Try the free JavaScript compiler

Returns the underlying buffer; obtaining it does not copy bytes.

Formal Syntax & Structure

javascript syntaxjavascript
view.buffer

Return Value

ArrayBuffer | SharedArrayBuffer

Backing buffer object.

Working Example

Example Snippetjavascript
const a=new Uint8Array([4,5]); const b=new Uint8Array(a.buffer); b[0]=9; console.log(a[0]);
JavaScript Reference