JavaScript TypedArray Methods

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

About This Index

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

Learn what a typed array is on /js/typed-array. Use this page when you need a specific method such as at(), subarray(), or toSorted().

One set of methods, eleven types.

Every typed array type, such as Uint8Array, Int16Array, or Float32Array, shares the same methods. They are inherited from a hidden parent class called TypedArray, which is why this tutorial writes TypedArray.from() for what you call as Uint8Array.from().

How to Call a TypedArray Method

Instance methods use a dot on the typed array. The two static methods are called on the type you want to create:

JavaScript
const bytes = new Uint8Array([3, 1, 2]);

// Instance methods (every typed array has them)
bytes.at(-1);             // 2
bytes.includes(3);        // true
bytes.sort();             // in place: 1, 2, 3 (numeric order)
bytes.toReversed();       // new copy: 3, 2, 1 (ES2023)
for (const v of bytes) {} // uses [Symbol.iterator]() for you

// Static methods (on the type you want)
Uint8Array.from([1, 2, 3]);
Int16Array.of(-1, 0, 1);

JavaScript TypedArray Methods Table

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

Create typed arrays

2 methods

Static methods on a concrete constructor such as Uint8Array or Int16Array. They build a brand-new typed array.

MethodDescriptionTutorial
TypedArray.from()Create a new typed array from an array, an iterable, or an array-like object, with an optional map function.Open
TypedArray.of()Create a new typed array from a list of arguments, such as Int16Array.of(1, -2, 3).Open

Read and find

8 methods

Read one element, or search for a value or for the first or last element that passes a test.

MethodDescriptionTutorial
at()Read the element at an index. Negative numbers count back from the end (ES2022).Open
find()Return the first element that passes a test, or undefined.Open
findIndex()Return the index of the first element that passes a test, or -1.Open
findLast()Return the last element that passes a test, searching from the end (ES2023).Open
findLastIndex()Return the index of the last element that passes a test, or -1 (ES2023).Open
includes()Check whether a value is in the typed array. It can also find NaN.Open
indexOf()Return the first index of a value, or -1 when it is not there.Open
lastIndexOf()Return the last index of a value, or -1 when it is not there.Open

Loop, test, and transform

7 methods

Run a callback for each element. The callback gets (value, index, array). map() and filter() return a new typed array of the same type.

MethodDescriptionTutorial
every()Check whether every element passes a test.Open
some()Check whether at least one element passes a test.Open
forEach()Run a function once for each element, together with its index.Open
filter()Keep the elements that pass a test, in a new typed array of the same type.Open
map()Change every element and get a new typed array of the same type. Results are converted to that type.Open
reduce()Combine all elements into one value, from left to right.Open
reduceRight()Combine all elements into one value, from right to left.Open

Copy, fill, and views

5 methods

Copy values in, copy a part out, make a view that shares memory, or overwrite a range with one value.

MethodDescriptionTutorial
set()Copy values from an array or another typed array into this one, at an offset.Open
subarray()Get a view of part of the typed array that shares the same memory (no copy).Open
slice()Copy part of the typed array into a new, independent typed array.Open
fill()Set every element, or a range of elements, to one value.Open
copyWithin()Copy a range of elements to another position inside the same typed array.Open

Reorder in place

2 methods

Change the order of the elements inside the same typed array. sort() is numeric by default.

MethodDescriptionTutorial
reverse()Reverse the order of the elements in place.Open
sort()Sort the elements in place. Numbers are compared as numbers by default.Open

Make a changed copy (ES2023)

3 methods

Non-mutating versions that return a new typed array and leave the original exactly as it was.

MethodDescriptionTutorial
toReversed()Return a reversed copy and leave the original unchanged (ES2023).Open
toSorted()Return a sorted copy and leave the original unchanged (ES2023).Open
with()Return a copy with one element replaced (ES2023).Open

Join and convert to text

3 methods

Turn the numbers into one string, with a separator or with locale formatting.

MethodDescriptionTutorial
join()Join all elements into one string with a separator of your choice.Open
toString()Turn the typed array into a comma-separated string.Open
toLocaleString()Turn the elements into a string with locale number formatting, such as 1,234.5.Open

Iterate

4 methods

Get an iterator of indexes, values, or [index, value] pairs for for...of loops, spread, and Array.from().

MethodDescriptionTutorial
keys()Get an iterator of the indexes 0, 1, 2, and so on.Open
values()Get an iterator of the element values.Open
entries()Get an iterator of [index, value] pairs.Open
[Symbol.iterator]()The built-in iterator behind for...of and spread. It is the same function as values().Open

Constructors and Properties

Constructors are used with new; properties are read with a dot and no parentheses. Replace Uint8Array with any of the 11 types. They are listed here for quick reference.

MemberWhat it gives you
new Uint8Array(length)A typed array with length elements, all set to 0.
new Uint8Array(arrayOrIterable)Copy numbers from an array or any iterable. Each value is converted to the element type.
new Uint8Array(buffer, byteOffset, length)A view on an existing ArrayBuffer, starting byteOffset bytes in.
ta.lengthNumber of elements. It never changes, unless the view follows a resizable ArrayBuffer (ES2024).
ta.byteLengthSize in bytes: length times BYTES_PER_ELEMENT.
ta.byteOffsetWhere the view starts inside its buffer, in bytes.
ta.bufferThe ArrayBuffer that really holds the bytes.
Uint8Array.BYTES_PER_ELEMENTBytes per element: 1, 2, 4, or 8. Also readable on every instance.

What Typed Arrays Do Not Have

Some Array methods do not exist on typed arrays. Calling them throws a TypeError because the property is undefined.

Array methodWhy it is missingWhat to do instead
push() pop() shift() unshift()The length is fixed when the typed array is created.Create a bigger typed array and copy the old values in with set().
splice() toSpliced()Both would need a different length.Build the result from slice() pieces and set().
concat()Not defined on typed arrays.new Uint8Array(a.length + b.length), then set(a) and set(b, a.length).
flat() flatMap()A typed array only holds numbers, never nested arrays.Use map(), or convert with Array.from() first.

Frequently Asked Questions

This index covers 34 of them: 2 static methods that create typed arrays (from and of) and 32 instance methods such as at(), map(), sort(), set(), subarray(), and toSorted(). Every typed array type, from Int8Array to BigUint64Array, has the same methods.
A typed array has a fixed length that is set when you create it, so methods that add or remove elements do not exist. That also rules out shift(), unshift(), toSpliced(), concat(), flat(), and flatMap(). Create a new typed array of the right size and copy values in with set() instead.
TypedArray is the hidden parent class of all typed array types, so you call the static methods on a real type: Uint8Array.from([1, 2, 3]) or Int16Array.of(-1, 0, 1). The type you call it on decides the type of the result.
at() arrived in ES2022. findLast(), findLastIndex(), toReversed(), toSorted(), and with() arrived in ES2023. All the others have existed since typed arrays were added in ES2015.
Mostly, and they share the same names. The main differences: sort() compares numbers as numbers by default, map(), filter(), and slice() return a typed array of the same type, subarray() shares memory instead of copying, and every value is converted to the element type.

Start with TypedArray.from()

Learn the most flexible way to create a typed array from an array, a string of digits, or any iterable.

TypedArray.from() 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