Complete worked example
typescript
type Role = { title: string };
function firstTitle(items: readonly Role[]): string {
return items[0]?.title ?? "No roles";
}- Reasoning
- The fallback responds to absence while preserving an intentionally empty title.