You can of course use let. However, if you work in a team, you will most likely encounter someone that changes your value without even being aware of it. For instance, if you define an array and call it listOfItems (I don’t recommend given such names, but this is just to prove an example), then someone decides to also create an array and give it the same name. If you use let, then that person will replace your array. However, if you use const, he will get an error when trying to change that array with name listOfItems. In terms of protection and preventing changes on critical values, go for const.

A rule of thumb is, use const always, and if you want to change the value, simply use let.

Check out this great article about var, let and const by Eric Elliott, click here

This is why I favor `const` over `let` in ES6. In JavaScript, `const` means that the identifier can’t be reassigned...

Software Engineer sharing interesting tech topics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store