• kevincox
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    I just tested and Terser will convert v === null || v === undefined to null==v. Personally I would prefer to read the code that explicitly shows that it is checking for both and let my minifier/optimizer worry about generating compact code.

    • SzethFriendOfNimi@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      10 months ago

      Try changing to const === variable. That’s most likely what’s it doing to minimize the risk of accidental assignment.

      • kevincox
        link
        fedilink
        arrow-up
        2
        ·
        10 months ago

        Wut? This is an automated optimizer. It is not worried about accidental assignment.