DEV Community

[Comment from a deleted post]
Collapse
 
russellbeattie profile image
Russell Beattie

I would humbly suggest not using const unless it's for a value where the variable name would normally be in ALL_CAPS. Const reduces the code's readability - as one is mentally parsing the code, seeing const makes you stop and think, "ooh, this is special and unchanging," only to discover it's just a plain object or function. Just use let unless you really, really need to make sure the value doesn't ever change, and you never want to reassign that variable name.

Collapse
 
cannuhlar profile image
Can Nuhlar

After I saw that code, I immediately checked for const usage in JS. Definitely caused a confusion for me. So, +1 for this.