- cross-posted to:
- [email protected]
- [email protected]
- cross-posted to:
- [email protected]
- [email protected]
Made with KolourPaint and screenshots from Kate (with the GitHub theme).
Made with KolourPaint and screenshots from Kate (with the GitHub theme).
More specifically, they’re borrowing the more mathematical meaning of variables, where if you say x equals 5, you can’t later say x is 6, and where a statement like “x = x + 1” is nonsense. Using “let” means you’re setting the value once and that’s what it’s going to remain as long as it exists, while “var” variables can be changed later. Functional languages, which are usually made by very math-y people, will often protest the way programmers use operators by saying that
=
is strictly for equality and variable assignment is:=
instead of==
and=
in most C-style languages.Unless you’re in JS.