• Caveman@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    edit-2
    19 hours ago

    I’ll join in

    const isEven = (n) 
      => !["1","3","5","7","9"]
        .includes(Math.round(n).toString().slice(-1)) 
    
    • Two9A@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      15 hours ago

      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.