Date Published: 13 February 2018
Prefer const Over let Or var
Use let For Loop Control Variables
Follow the first rule and use const wherever you can. But there are some cases where you can't, like when you're writing a loop. In that case, you should default to using let. Let is block scoped just like const, but can be re-assigned, as is required by looping constructs like for loops.
Steve is an experienced software architect and trainer, focusing currently on ASP.NET Core and Domain-Driven Design.