Hint
find = first match (or undefined). filter = all matches (always an array).
const users = [
{ id: 1, name: 'Alice' },
{ id: 2, name: 'Bob' },
{ id: 3, name: 'Alice' },
];
const first = users.find(u => u.name === 'Alice');
const all = users.filter(u => u.name === 'Alice');
console.log(first.id);
console.log(all.length);1 2
Explanation: find returns the first Alice (id=1). filter returns all Alices — 2 results.
Key Insight: find = first match (or undefined). filter = all matches (always an array).