DEV Community

Discussion on: Is`let` the new `var` in Javascript?

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

well, "you are free to use any of those" it's not that "as is" at all. If you use const and you don't know how consts works you'll get stuck trying to imagine why this fkin const is not changing their value even set on a lefthand just before. 😆

Collapse
 
amt8u profile image
amt8u

Yeah, of course - been there:-D. But I guess, engines report the re-assignment error properly. At least on browser you get - Uncaught TypeError: Assignment to constant variable. And I did start with "as far as you understand the difference", If you don't then you can always follow what others are doing. Use let everywhere.