// 🛡️ "?." only protects "nullish obj" and "direct prop"
// ❗ "." provides NO protection.
// ❗ "root" object is NEVER protected.
jane . boyfriend ?. name // ✅ boyfriend: non-nullish, ok.
// ╰──❗───╯ ╰🛡️╯
jane . boyfriend ?. money . more // ✅ money: direct prop, protected.
// ╰──❗───╯ ╰─🛡️─╯ ╰❗╯ // ❗ more: not protected, error may occur.
⭐️ use ?. for reading / deleting, but notwriting❗️
user?.name // ✅ read if exists
delete user?.name // ✅ delete if exists.
user?.name = "John" // ⛔ SyntaxError
// Invalid left-hand side in assignment
// this is literally `undefine = "John"`❗️
let a = { b: null };
a.b?.c.d, // ✅ this is OK (⭐ "short-circuiting" works.)
// ╭─ UD ─╮ // UD: undefined
(a.b?.c).d, // ❌ DON'T DO THIS! (⛔ TypeError❗)
// ^
const city = user ?. city ?? "Unknown city"
// ╰── O.C. ──╯ ╰─ default ──╯