JavaScript ArrayBuffer Methods

Beginner
4 min read
Updated: Nov 2026
5 method guides
Method index

About This Index

This page is the JavaScript ArrayBuffer Methods index for the tutorial track. Each row links to a full guide with syntax, three runnable examples, browser notes, and FAQs.

Learn what an ArrayBuffer is on /js/array-buffer. Use this page when you need a specific API such as slice(), resize(), or transfer().

Bytes are read through views.

ArrayBuffer methods copy, resize, and move memory. To read or write individual bytes, wrap the buffer in a typed array such as Uint8Array or in a DataView.

How to Call an ArrayBuffer Method

Instance methods use a dot on the buffer; the one static helper uses ArrayBuffer:

JavaScript
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
const bytes = new Uint8Array(buffer);   // a view for reading and writing

// Instance (ArrayBuffer.prototype)
buffer.slice(0, 4);                // new 4-byte copy
buffer.resize(12);                 // grow in place (ES2024)
const moved = buffer.transfer();   // move bytes, detach buffer (ES2024)
moved.transferToFixedLength();     // move again, lock the size (ES2024)

// Static (on ArrayBuffer)
ArrayBuffer.isView(bytes);         // true

JavaScript ArrayBuffer Methods Table

All method guides in this JavaScript tutorial series (5 tutorials), grouped by what they do.

Check for views

1 method

A static helper on the ArrayBuffer constructor that tells views (typed arrays and DataView) apart from everything else.

MethodDescriptionTutorial
ArrayBuffer.isView()Check whether a value is a view (any typed array or a DataView) over an ArrayBuffer.Open

Resize in place

1 method

Grow or shrink a buffer that was created with maxByteLength, without allocating a new one (ES2024).

MethodDescriptionTutorial
resize()Grow or shrink a resizable ArrayBuffer in place, up to its maxByteLength (ES2024).Open

Copy bytes

1 method

Copy a byte range into a new, independent buffer. Works on every ArrayBuffer since ES2015.

MethodDescriptionTutorial
slice()Copy a range of bytes into a new, independent ArrayBuffer. Negative indexes count from the end.Open

Transfer ownership

2 methods

Move the bytes into a new buffer and detach the original, optionally changing the length on the way (ES2024).

MethodDescriptionTutorial
transfer()Move the bytes into a new ArrayBuffer (optionally resized) and detach the original (ES2024).Open
transferToFixedLength()Move the bytes into a new fixed-length ArrayBuffer and detach the original (ES2024).Open

ArrayBuffer Properties and Constructor

These are read with a dot (no parentheses) or used with new. They are listed here for quick reference.

MemberWhat it gives youSince
new ArrayBuffer(length)Create a fixed-length buffer of length bytes, all set to 0.ES2015
new ArrayBuffer(length, { maxByteLength })Create a resizable buffer that resize() can grow up to maxByteLength.ES2024
buffer.byteLengthCurrent size in bytes. It changes after resize() and becomes 0 after a transfer.ES2015
buffer.maxByteLengthThe largest size resize() allows. For a fixed-length buffer it equals byteLength.ES2024
buffer.resizabletrue when the buffer was created with maxByteLength.ES2024
buffer.detachedtrue after transfer() or transferToFixedLength() moved the bytes away.ES2024

Frequently Asked Questions

There are five: the static ArrayBuffer.isView(), and the instance methods slice(), resize(), transfer(), and transferToFixedLength(). Reading and writing bytes is not done with ArrayBuffer methods at all; you use a typed array or DataView view for that.
The ArrayBuffer page explains what a buffer is, how views share its memory, and how resizing and transferring work. This index lists every method tutorial plus the ArrayBuffer properties, so you can jump straight to the API you need.
Instance methods use a dot on the buffer: buffer.slice(0, 4), buffer.resize(16), buffer.transfer(). The only static helper is called on the constructor: ArrayBuffer.isView(value).
resize(), transfer(), transferToFixedLength(), and the maxByteLength, resizable, and detached properties arrived in ES2024. slice() and isView() have existed since ES2015 and work everywhere.
Read JavaScript ArrayBuffer first, then slice() for copying bytes and isView() for accepting buffers or typed arrays. Move on to resize() and the transfer methods when you need growable buffers or ownership hand-offs.

Start with ArrayBuffer.isView()

Learn to accept either a raw buffer or a typed array in your functions.

isView() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful