jroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agoknow the features of your languagelemmy.worldimagemessage-square136fedilinkarrow-up1562arrow-down120
arrow-up1542arrow-down1imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agomessage-square136fedilink
minus-squareKogasa@programming.devlinkfedilinkarrow-up0arrow-down1·1 year agoIt’s probably valid javascript that returns “-1” or the empty string depending on if “b” is undefined or null
minus-squaremurtaza64@programming.devlinkfedilinkarrow-up1·edit-21 year agoYou don’t need the and right? Can’t it just be return a or b This doesn’t work if a is falsy non-null actually
return a and a or b
Lua. My beloved.
That’s valid Python as well
It’s probably valid javascript that returns “-1” or the empty string depending on if “b” is undefined or null
You don’t need the and right? Can’t it just be
return a or b
This doesn’t work if a is falsy non-null actually