JavaScript ArrayBuffers

An ArrayBuffer is an array of fixed length bytes. Also called a byte array.

An ArrayBuffer simply contains data. You cannot directly interact with the data in it. To do so, you must convert an ArrayBuffer to a Typed Array or a DataView object.

ArrayBuffers have a slice method which works like array.slice. Slice takes 2 arguments. The first marks the index of the first byte in the buffer and the second marks the last index. Slice will return that portion of the byte array. Providing no arguments will return a copy of the buffer.