• Soviet Snake
    link
    fedilink
    arrow-up
    8
    ·
    2 years ago

    How? What? Is this real? Could someone explain why? Is there a use?

    • kevincox@lemmy.ml
      link
      fedilink
      arrow-up
      7
      ·
      2 years ago

      The source of this appears to be that 0.0000001.toString() == "1e-7". Presumably parseInt first converts its argument to a String (which kinda makes sense).

      Of course the more important question is why are you passing a number to parseInt?