JavaScript 2025 · Arrays
Find the first match
Return the first item that passes a test, or undefined if none does.
const user = users.find((u) => u.id === 42);
Official JavaScript 2025 documentation
JavaScript 2025 · Arrays
Return the first item that passes a test, or undefined if none does.
const user = users.find((u) => u.id === 42);
Official JavaScript 2025 documentation
Was this page helpful?