The idea that JS programmers can't learn from others' languages first is an odd one considering that, if I remember correctly, const in JS has the same semantics as the final keyword in Java and it's the default semantics of any local variable in Rust, so it's not something that seems to be out of the ordinary or falling out of favor.
Why would you choose to weaken the communication in your code by choosing `let` over `const` when you have no intention of reassign the value? `let` would just confuse the reader as they'd start anticipating the reassignment.
Compare:
```
// A variable containing an object that will not be reassigned
const a = { foo: 10};
// This is still valid
a.foo = 10;
```
vs
```
// A variable containing an object that might be reassigned.
let a = { foo: 10};
// This is still valid
a.foo = 10;
```
The first example says more about your intent and throwing that information away is a bad idea.
I almost never use variable mutation in JS, and I use let almost everywhere.
That lets me use the let/const distinction in a way that to me seems even more informative, namely to distinguish actual constants like "site base URL" or "pi".
(defvar *db* nil)
(defun add-record (cd) (push cd *db*))
(defun make-cd (title artist rating ripped)
(list :title title :artist artist :rating rating :ripped ripped))
(add-record (make-cd "Roses" "Kathy Mattea" 7 t))
If you're concerned about this kind of thing, we should be encouraging novice programmers to stop using language features they don't understand.[0]: http://www.gigamonkeys.com/book/practical-a-simple-database....
(defun load-db (filename)
(with-open-file (in filename)
(with-standard-io-syntax
(setf *db* (read in)))))
[0]: http://www.gigamonkeys.com/book/practical-a-simple-database....In Typescript anyway, `const` means I am not allowed to reassign. Attempting to change it just will cause compiler warnings. If you mean that, ignore Typescript and tooling, and that once the code is in the browser executing, then consts can be changed.... Who cares about that?