Name
TypedArray — fixed-size binary arrays
Inherits from
ArrayBufferView
Synopsis
A TypedArray is an ArrayBufferView that interprets the bytes of an underlying ArrayBuffer as an array of numbers and allows read and write access to the elements of that array. This page does not document a single type named TypedArray. Instead, it covers eight different kinds of typed arrays. These eight types are all subtypes of ArrayBufferView, and they differ from each other only in the number of bytes per array element and the way those bytes are interpreted. The eight actual types are:
Int8ArrayOne byte per array element, interpreted as a signed integer.
Int16ArrayTwo bytes per array element, interpreted as a signed integer, using platform byte order.
Int32ArrayFour bytes per array element, interpreted as a signed integer, using platform byte order.
Uint8ArrayOne byte per array element, interpreted as an unsigned integer.
Uint16ArrayTwo bytes per array element, interpreted as an unsigned integer, using platform byte order.
Uint32ArrayFour bytes per array element, interpreted as an unsigned integer, using platform byte order.
Float32ArrayFour bytes per array element, interpreted as a floating-point number, using platform byte order.
Float64ArrayEight bytes per array element, interpreted as a floating-point number, using platform byte order.
As their name implies, these are array-like objects, and you can get and set element values using normal square-bracket array notation. Note, however, that objects of these ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access