Bayu walks nasabah?.alamat.kota drawer by drawer: what happens when a plain dot meets null, and what does ?. guard at each place it is written? An interactive…
API data often has fields that are sometimes there, sometimes null. Without ?., one empty field means a blank screen. ?. (with ?? for defaults) makes data access sturdy without long && chains.
?. stops at null or undefined, and the rest never runs
?. only on the first step and still crashing nasabah?.alamat.kota still throws when alamat is null. Put ?. on every step that can be empty.?. guards against every falsy value Only null and undefined. 0, '' and false count as present, and the chain goes on.?. everywhere until errors go silent Use it only where empty is valid. Data that should always be there is better off throwing early than silently turning into undefined.?. ?. meets null: the result is undefined, the rest never runs.?.() It is not called; the result is undefined.