https://dev.to/valentinogagliardi/once-and-for-all-const-in-...
Other thing is (and I believe this is what the OP is asking you) - if you say:
const a = 1;
a will always be 1 (inside the scope).
Sure if you say:
const o = { a: 1};
you can change the value of a inside the o, but the o (the pointer as the OP is saying) is not changed. I have 0 experience with Elm, but a _lot_ of popular languages have this behaviour for const/final
I think the article I linked to earlier was already sufficiently unambiguous. To clarify once again: If you can mutate a value, then the value is mutable. Mutable means it is not immutable. The `const` keyword in JavaScript does not give you an immutable value.
Point the OP was getting at: 'const' gives you an immutable reference to a mutable value because it is a modifier for the reference and not the value.
Yes, the article you linked was unambiguous, but for another question :)
As i said, a lot of langugaes (I don't know any that behaves differently) uses the const/final modifiers in this way.
In my experience with people that are just learning how to code, it is a more efficient to point out what is the 'const' modifier making a constant of, than pointing out what it does not do, because the latter sometimes sends a message that the 'const' is useless as it 'does not do anything'.
Perhaps this would be clearer: "The identity of a const object is immutable but its state can be mutable."