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 find() method of TypedArray instances returns the first element in the provided typed array that satisfies the provided testing function. If no values satisfy the testing function, undefined is returned. This method has the same algorithm as Array.prototype.find().
A function to execute for each element in the typed array. It should return a truthy value to indicate a matching element has been found, and a falsy value otherwise. The function is called with the following arguments:
elementThe current element being processed in the typed array.
indexThe index of the current element being processed in the typed array.
arrayThe typed array find() was called upon.
thisArg OptionalA value to use as this when executing callbackFn. See iterative methods.
The first element in the typed array that satisfies the provided testing function. Otherwise, undefined is returned.
See Array.prototype.find() for more details. This method is not generic and can only be called on typed array instances.
The following example returns the first element in the typed array that is a prime number, or undefined if there is no prime number.
Note: The isPrime() implementation is for demonstration only. For a real-world application, you would want to use a heavily memoized algorithm such as the Sieve of Eratosthenes to avoid repeated calculations.
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.find |
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.