Favorites

JavaScript Array.prototype.find() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Array.prototype.find()
JavaScript Array Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The find() method returns the first element in an array that passes a test, or undefined if no element does.

Description

The find() method returns the first element for which the callback returns a truthy value, and stops searching as soon as it finds it. If nothing matches, it returns undefined.

It is the usual way to look up an object by a property, such as a user by ID. Use findIndex() if you need the position, findLast() to search from the end, filter() for all matches, and includes() to check for a specific value.

Because it returns the element itself, find() gives you a reference to the original object, so changing its properties changes the object in the array. If the array can legitimately contain undefined, you can't tell "not found" from "found undefined"; use findIndex() in that case. The callback is called for every index, including empty slots.

Syntax

array.find(callbackFn)
array.find(callbackFn, thisArg)

Parameters

  • callbackFnA function called for each element, receiving element, index and array.
  • thisArgOptional. A value to use as this inside callbackFn.

Return Value

The first element that passes the test, or undefined if none does.

Example

const users = [{ id: 1, name: 'Sam' }, { id: 2, name: 'Alex' }];
console.log(users.find(u => u.id === 2));
console.log(users.find(u => u.id === 9));
console.log([4, 9, 16].find(n => n > 5));

Browser Support

The following information will show you the current browser support for the Array.prototype.find() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee