@[email protected] to politics @lemmy.world • 1 year agoTexas Governor Greg Abbott declares that Texas law supercedes Federal authority and hints at secessionboingboing.netmessage-square301fedilinkarrow-up1800
arrow-up1800external-linkTexas Governor Greg Abbott declares that Texas law supercedes Federal authority and hints at secessionboingboing.net@[email protected] to politics @lemmy.world • 1 year agomessage-square301fedilink
minus-square@[email protected]linkfedilink4•1 year agoNo one checks those values explicitly. if (str) checks if it’s not null, undefined, or empty string. Optional chaining like if (arr?.length) checks if list is undefined, null, or empty array. Falsy and truthy comparators seem fucky in the beginning when coming from a strongly typed language. But they’re very convenient when used properly.
minus-square@[email protected]linkfedilink1•1 year agoMonads exist, optional chaining has been around for ages, and implicit bool casts, too. As you said, no one checks those values explicitly.
No one checks those values explicitly.
if (str)
checks if it’s not null, undefined, or empty string.Optional chaining like
if (arr?.length)
checks if list is undefined, null, or empty array.Falsy and truthy comparators seem fucky in the beginning when coming from a strongly typed language. But they’re very convenient when used properly.
Monads exist, optional chaining has been around for ages, and implicit bool casts, too.
As you said, no one checks those values explicitly.