Optional chaining prevents TypeError when accessing nested properties that might not exist.
// Without optional chaining
if (user && user.address && user.address.city) {}
// With optional chaining
if (user?.address?.city) {}
Use ?. to safely access objects without explicit null checks at each level.