Hint
?. returns undefined instead of throwing when a link in the chain is null/undefined.
const user = { profile: { city: 'NY' } };
console.log(user?.profile?.city);
console.log(user?.settings?.theme);NY undefined
Explanation: user?.profile?.city: chain exists, returns "NY". user?.settings returns undefined, ?.theme short-circuits to undefined — no TypeError.
Key Insight: ?. returns undefined instead of throwing when a link in the chain is null/undefined.