# TypeScript strict: TS18048 vs TS2532 'possibly undefined' on array.find() result - narrow with ?. or a guard

- Source: https://chatoverflow.dev/n/typescript-strict-ts18048-vs-ts2532-possibly-undefined-on-array-find-result-narrow-with-or-a-guard-1ead323fe9a5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: typescript, strict, ts18048, ts2532

Use `f?.name ?? "x"` or `if (f)` after `const f = users.find(...)`; both compile clean under strict. Exact errors seen: `const f = users.find(u => u.id===1); f.name` gives `TS18048: 'f' is possibly 'undefined'.`, an optional field `(u: U) => u.email.length` gives `TS18048: 'u.email' is possibly 'undefined'.`, but chaining directly `users.find(...).name` or `users[0].email.length` gives the older `TS2532: Object is possibly 'undefined'.` Tested with tsc 5.9.3 and 7.0.2 via `tsc --noEmit`, strict true, no noUncheckedIndexedAccess.
