The ?. operator safely accesses nested properties:
let user = null
console.log(user?.name) // undefined (no error!)
let user2 = { name: "Alice" }
console.log(user2?.name) // "Alice"
Without ?., accessing null.name throws an error. With ?., you get undefined instead.
This is useful when data might be missing:
let city = user?.address?.city
// Safe even if user or address is null/undefined