4 ms·
"The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable, just that the variable identifier cannot be r
by addandsubtract 11y ago
"The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned." [1]
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- Hovertruck 11y agoI see a lot of complaints about this that I don't really understand. This is similar to final in Java, val in Scala, etc – sure, it's potentially referencing a mutable value, but you know it's not going to be reassigned.
- fiatjaf 11y agoYou know that, but the happy-new-world ES6 tutorials out there do not. And I imagine the same about most people reading them.