• MakeAvoy@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    11 months ago

    Except strict equality, that’s a JavaScript only problem. Imagine thinking "0" should be falsy in comparison due to string literal evaluation, but truthy with logical not applied based on non-empty string. Thus !"0"=="0" is true. They couldn’t just throw away == and start over nooooo let’s add === . Utter madness

    • soloner@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      11 months ago

      Browser compatibility. Design flaws can’t easily be fixed like how other languages can just switch to a new major version and introduce breaking changes. ES must keep backwards compatibility so has had to do more additive changes than replacing behavior altogether so that older web pages pages don’t break.