# Array `find` and Arrow Functions `Array.prototype.find` returns the first element that matches a condition. ## Example ```ts const parts = [ { type: 'year', value: '2026' }, { type: 'month', value: '03' }, { type: 'day', value: '24' }, ]; const yearPart = parts.find((part) => part.type === 'year'); console.log(yearPart); // { type: 'year', value: '2026' } ``` ## Arrow Function Syntax ```ts (part) => part.type === 'year' ``` - `(part)`: parameter. - `=>`: arrow token. - `part.type === 'year'`: expression result (`true` or `false`). If no item matches, `find` returns `undefined`. ## Python Comparison Similar to: ```py year_part = next((p for p in parts if p['type'] == 'year'), None) ```