loading...

re: Demystifying "const" variables in JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: As a common rule, I suggest using const to declare all new variables, and when you come across a point where you need to reassign one of those vari...
 

It's always been my rule of thumb.

Use const. If you need to reassign it, change the variable to let. No reason to use var anymore.

 

One reason to use var: prototype something in the browser console and get something wrong, for that session your const won't be changeable, so use var for fast prototyping

code of conduct - report abuse