Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.
The at() method of TypedArray instances takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the typed array. This method has the same algorithm as Array.prototype.at().
Zero-based index of the typed array element to be returned, converted to an integer. Negative index counts back from the end of the typed array — if index < 0, index + array.length is accessed.
The element in the typed array matching the given index. Always returns undefined if index < -array.length or index >= array.length without attempting to access the corresponding property.
See Array.prototype.at() for more details. This method is not generic and can only be called on typed array instances.
The following example provides a function which returns the last element found in a specified array.
Here we compare different ways to select the penultimate (last but one) item of a TypedArray. Whilst all below methods are valid, it highlights the succinctness and readability of the at() method.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.at |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.