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 September 2016.
The indexOf() method of TypedArray instances returns the first index at which a given element can be found in the typed array, or -1 if it is not present. This method has the same algorithm as Array.prototype.indexOf().
Element to locate in the typed array.
fromIndex OptionalZero-based index at which to start searching, converted to an integer.
The first index of searchElement in the typed array; -1 if not found.
See Array.prototype.indexOf() for more details. This method is not generic and can only be called on typed array instances.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.indexof |
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.