• somedev
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    1 month ago

    I’m guessing the + + in the middle returns NaN

    • Victoria@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 month ago

      Indeed, the unary plus operator tries to convert whatever is after it to a number if it isn’t already. Since ‘a’ is not a valid number, it returns NaN (not a number)