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

More arrays commands

All arrays commands · JavaScript 2025 cheatsheet

Was this page helpful?