austin-cheney 10 months ago

I believe use of the equal sign character for assignment is a convention that comes from Fortran. It’s so unnecessary because JavaScript has two assignment operators. The colon character serves as an assignment operator in object literals and ternary expressions. If the colon character were the universal assignment character the language wouldn’t need == or === for comparison because = would be enough.

  • meiraleal 10 months ago

    > If the colon character were the universal assignment character the language wouldn’t need == or === for comparison because = would be enough.

    You would need to break a few basic JS premises too:

      0 = false
      0 != false