@[email protected] to Programmer [email protected] • 1 year agoknow the features of your languagelemmy.worldimagemessage-square145fedilinkarrow-up1647arrow-down124
arrow-up1623arrow-down1imageknow the features of your languagelemmy.world@[email protected] to Programmer [email protected] • 1 year agomessage-square145fedilink
minus-square@[email protected]linkfedilink17•edit-21 year agoNot strictly equivalent, since || tests for truthiness, not just null.
minus-square𝕱𝖎𝖗𝖊𝖜𝖎𝖙𝖈𝖍linkfedilink-1•1 year agoThat’s fair, but it’s close enough that it functions identically
minus-square@[email protected]linkfedilink4•1 year agoOnly for the null case. For other cases it doesn’t function identically, since it also treats "", 0 and undefined the same as null.
Typescript/Javascript too
Not strictly equivalent, since
||
tests for truthiness, not just null.That’s fair, but it’s close enough that it functions identically
Only for the
null
case. For other cases it doesn’t function identically, since it also treats""
,0
andundefined
the same asnull
.