オブジェクトのプロパティが存在しない場合でも、エラーを起こさずにプロパティを参照できる安全な方法。
ネストしたオブジェクトにも使用できる。
const book = undefined; const title = book?.title; console.log(title); undefined const book = undefined; const authorEmail = book?.author?.email; console.log(authorEmail); undefined
参考