DEV Community

Discussion on: Demystifying "const" variables in JavaScript

Collapse
 
johncip profile image
jmc • Edited

Agreed, defaulting to const is useful if because then when you see a let you know it must get reassigned.

More generally, sometimes variables are "values," and sometimes they're "places," and to me it's worth an extra two characters to be clear about which I'm using.

It's not about avoiding any sort of actual risk -- just about writing code that better expresses its intent.