Explain ?. and ?? , how ?? differs from || , and what ??= / ||= / &&= do.
Precise semantics of nullish (null/undefined) vs falsy — the subtle bug source when defaulting 0 or empty string.
Optional chaining `a?.b` short-circuits to `undefined` (not an error) the moment the value to its LEFT is null or undefined, so `user?.address?.city` is safe when address is missing. It works for property access, dynamic keys `a?.[k]`, and calls `fn?.()` (calls only if fn is not nullish). Crucially it short-circuits the WHOLE remaining chain — `a?.b.c.d` stops at a being nullish and doesn't touch b.c.d. Nullish coalescing `x ?? fallback` returns fallback ONLY when x is null or undefined — unlike `||`, which also falls back on any falsy value (0, '', false, NaN). That difference is the classic bug: `count || 10` turns a legitimate 0 into 10; `count ?? 10` keeps the 0. The two combine idiomatically: `const city = user?.address?.city ?? 'Unknown'`. Logical assignment operators are the compound forms: `x ??= v` assigns v only if x is nullish; `x ||= v` assigns if x is falsy; `x &&= v` assigns if x is truthy — each short-circuits (skips the assignment, and evaluating v, when the condition isn't met), which is useful for lazy defaulting without clobbering existing values.
Reading deep/optional API payloads, applying defaults where 0 and '' are valid, and lazily initialising config without overwriting.