-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Explanation of 'const' does not convey mutability #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How is that addressed in PR #51 ? This section seems to convey that But no, this is not addressed in either of those. |
Sorry, I misunderstood that the issue is about this paragraph. The paragraph has to be rewritten, of course. |
That's true, const properties can be changed and are mutable. The section was referring to primitive values of declared constants. Of course that's not their only use. Please update it to your understanding. Thanks. |
Thanks Arayi! You're right that the paragraph doesn't do the best job explaining the nature of the keyword |
This subsection was removed for the time being, until we come up with a better explanation for when to prefer |
In JS,
const
is NOT immutable—it can be changed but cannot be reassigned(See https://mathiasbynens.be/notes/es6-const for a more detailed explanation)
I've seen this confuse many new devs, so I'd like to suggest including this information. I'll make a PR with the edit if you'd like. 🎉
The text was updated successfully, but these errors were encountered: