TypeScript · Junior · Question 65 of 75
What's the result type of user?.address?.city if city: string?
- ✓Correct answer:
string | undefined - 2
string - 3
string | null
Explanation
Optional chaining stops at the first null/undefined and returns undefined, so the result type includes it.