loading...

re: Demystifying "const" variables in JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Do you like constant case?
 

Not OP, but I mentally distinguish between "values," which use const but tend to be local / temporary, and "constants," which also use const but tend to be in outer scope. I use screaming snake case only for the latter, if at all.

IMO when most of your values are immutable, which is a good place to be, the constants stop being special. Instead, the the things that can change over time are special, as they should be, since they require more effort to reason about.

code of conduct - report abuse