Hacker News new | past | comments | ask | show | jobs | submit login

"read-only constants". This is a crazy thing to say and people are believing this.



Explain?


"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/Refe...


I 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.


You know that, but the happy-new-world ES6 tutorials out there do not. And I imagine the same about most people reading them.


I can't speak to the intent of the post you responded to, but to me constants are by definition read-only and so it sounded a little redundant to me




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: