…or I could change programming languages comparison of the notation of the not equals operator to create the illusion of JavaScript being the outlier here. To display a special symbol in a JavaScript alert message or a confirm dialog box, use the hexadecimal code of the symbol, for example. When you use the comparison operator (strictly equal), the two character strings being. Literally every other programming language (FORTRAN, Haskell, Lisp, ALGOL, Pascal, Ada, Eiffel) uses /= for the “not equal to” operator. The not character (), is synonymous with the backslash (). I’m not asking to remove ~=, it’d just change /= to ~= in the backend so we have the option to use either. It would be nice if Roblox’s Luau had syntax sugar to allow us to write /= instead of ~=. I could rephrase this section of argument to argue that /= could also be a syntax sugar to ~=: This is the exact opposite functionality of the equals sign (), which will output TRUE if the values on either side of it are equal and FALSE if they are not. That is not a built-in global function in JavaScript, but it likely refers to the reduce () method on JavaScript arrays. So most JavaScript developers use where possible. So most JavaScript developers use where possible. The operator in JavaScript does type coercion, which often has surprising results, like how ' ' false. Should the not equal operator also be allowed to be written as /= and ? The operator in JavaScript does type coercion, which often has surprising results, like how false. Perhaps you only selected programming languages with the not equal operator being != as an example (confirmation bias(?))? Just because these programming languages uses the != notation (perhaps it was derived from C even if these programming languages don’t use braces for control blocks) for not equals operation does not mean all other programming languages uses !=.
0 Comments
Leave a Reply. |