Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Let's review the original way to declare a variable and how that differs with the modern let and const keywords.
declare a variable, using the var keyword.
a lot still use the var keyword, but
some of the behaviors from using var can be problematic or unexpected.
decided to introduce new ways for creating variables.
ECMAScript 2015, introduce two new keywords.
Const and let.
In this workshop, I'll show you how const and let work.
And explain why you'll want to use them instead of var, when declaring variables.
I just want to mention that const and let work in a similar way to var.
In each case, you use the keyword var, const, or let.
Followed by the name of the variable, an equal sign and
the value you want to put into that variable.
So, when should you use const and when should you use let?
I'll answer them in the next few videos.
You need to sign up for Treehouse in order to download course files.Sign up