Mathematical Symbols and JavaScript Equivalents
(math4devs.com)4 points by kiyanwang 2 months ago | 4 comments
4 points by kiyanwang 2 months ago | 4 comments
meiraleal 2 months ago | root | parent |
> 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
austin-cheney 2 months ago | root | parent |
0 = false
0 ! false
meiraleal 2 months ago | root | parent |
LOL
austin-cheney 2 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.