jroid8@lemmy.world to Programmer Humor@lemmy.ml · 11 months agoknow the features of your languagelemmy.worldimagemessage-square144fedilinkarrow-up1642arrow-down124
arrow-up1618arrow-down1imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 11 months agomessage-square144fedilink
minus-squarecerement@slrpnk.netlinkfedilinkarrow-up1·11 months agoit’s just return a and b or c is the closest Lua has to a ternary operator, but yes, for the above you could shorten it to return a or b (“or returns the first argument if true, otherwise second argument is returned”)
it’s just
return a and b or c
is the closest Lua has to a ternary operator, but yes, for the above you could shorten it toreturn a or b
(“or
returns the first argument if true, otherwise second argument is returned”)