nullやundefinedの場合にエラーを投げずundefinedを返す
const user = { profile: { name: 'Alice' } };
user?.profile?.name; // 'Alice'
user?.address?.city; // undefined (エラーにならない)
user?.greet?.(); // undefined (メソッドも安全に呼べる)
arr?.[0]?.name; // 配列インデックスも対応TypeScriptでは型が自動的にT | undefinedに広がる。nullish coalescingと組み合わせてデフォルト値を設定できる。