Standard built-ins

ArrayBuffer.prototype.maxByteLength

Try the free JavaScript compiler

Maximum size of a resizable buffer, or the current length of a fixed buffer. A detached buffer reports zero.

Formal Syntax & Structure

javascript syntaxjavascript
buffer.maxByteLength

Return Value

number

Maximum byte capacity.

Working Example

Example Snippetjavascript
const b = new ArrayBuffer(2, {maxByteLength: 8}); b.resize(4); console.log(b.byteLength, b.maxByteLength);
JavaScript Reference