@jroid8 to Programmer [email protected] • 1 year agoknow the features of your languageimagemessage-square144arrow-up1647arrow-down123starcopymore-verticalflagCreate ReportslashBlock user
arrow-up1624arrow-down1imageknow the features of your language@jroid8 to Programmer [email protected] • 1 year agomessage-square144starcopymore-verticalflagCreate ReportslashBlock user
minus-square𝕱𝖎𝖗𝖊𝖜𝖎𝖙𝖈𝖍link5•1 year agoTypescript/Javascript too arrow-up16arrow-down11file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock user
minus-square@FooBarringtonlink17•edit-21 year agoNot strictly equivalent, since || tests for truthiness, not just null. arrow-up117arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock user
minus-square𝕱𝖎𝖗𝖊𝖜𝖎𝖙𝖈𝖍link-1•1 year agoThat’s fair, but it’s close enough that it functions identically arrow-up11arrow-down12file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock user
minus-square@FooBarringtonlink4•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. arrow-up14arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock user
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
.