Hacker News new | past | comments | ask | show | jobs | submit login
Mathematical Symbols and JavaScript Equivalents (math4devs.com)
4 points by kiyanwang 4 months ago | hide | past | favorite | 4 comments



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.


> 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


    0 = false
    0 ! false


LOL




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: