DEV Community

Discussion on: Confused by JavaScript's const? Me too!

Collapse
remotesynth profile image
Brian Rinaldi Author

Thanks for the comment. I had received similar recommendations. A team that I worked with even had ESLint set to enforce using const for every variable where it wasn't reassigned - even objects that were mutated. This is where it caused me confusion and it was probably more common than actual primitive constants in the code. As a personal style preference, I would not choose to do that where I have the option.