Optional chaining (`?.`) short-circuits to `undefined` if any link in a property/method/index chain is `null` or `undefined`, instead of throwing.
ts
interface Profile { wallet?: { address?: string } }
const p: Profile = {};
const addr = p.wallet?.address; // string | undefined, no throw
const upper = p.wallet?.address?.toUpperCase() ?? "UNKNOWN";Nullish coalescing (`??`) supplies a fallback only when the left side is `null`/`undefined` — unlike `||`, it won't override valid falsy values like `0`, `""`, or `false`. Together they replace long chains of manual `if (a && a.b && a.b.c)` guards with a single expression.