When to use var, let, and const in JavaScript

One of the things that put me off learning JavaScript years ago is when they introduced let and const alongside var and I got super confused by which one to use. In the video above, Chris Ferdinandi joined Kevin Powell on his channel and demonstrated the difference between each one and which one you should use for which purpose.

Funnily enough, I also found another video before this one today about the misuse of const but I’ve not watched that because I’ve just started enjoying JS and I don’t want anything to disturb my peace.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.