• foxglove (she/her)
    link
    fedilink
    English
    arrow-up
    15
    ·
    4 months ago

    if it’s 'FILE_NOT_FOUND' then the string will be read as truthy and you will get 'User is admin' logged.

    • Björn@swg-empire.de
      link
      fedilink
      arrow-up
      30
      ·
      4 months ago

      Ackshually three equal signs check for type as well. So mere truthiness is not enough. It has to be exactly true.

      Also, everyone knows FILE_NOT_FOUND isn’t a string but a boolean value.

      • foxglove (she/her)
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months ago

        yeah, it’s funny how my brain collapsed the boolean check into if (role) rather than if (role === true) - that’s tricky

        what is FILE_NOT_FOUND? I can’t find much on it …