Destide@feddit.uk to Programmer Humor@lemmy.mlEnglish · 18 hours agoInfallible Codelemmy.mlimagemessage-square125fedilinkarrow-up1370arrow-down118
arrow-up1352arrow-down1imageInfallible Codelemmy.mlDestide@feddit.uk to Programmer Humor@lemmy.mlEnglish · 18 hours agomessage-square125fedilink
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up12·edit-210 hours agoI’ll join in const isEven = (n) => !["1","3","5","7","9"] .includes(Math.round(n).toString().slice(-1))
minus-squareTwo9A@lemmy.worldlinkfedilinkarrow-up3·6 hours agoI’ve actually written exactly that before, when I needed to check the lowest bit in an SQL dialect with no bitwise operators. It was disgusting and awesome.
I’ll join in
const isEven = (n) => !["1","3","5","7","9"] .includes(Math.round(n).toString().slice(-1))
I’ve actually written exactly that before, when I needed to check the lowest bit in an SQL dialect with no bitwise operators. It was disgusting and awesome.