Variables
In programming we often want to describe something.
We have a person named Bob. We’d like to track Bob’s age.
Bob is 37.
Variables
are how we store values
like 37
so we can use that value again later in our program.
Let’s look at some examples…
Var keyword
In JavaScript we can store a value in a variable with the var
keyword.
Here we assigned a number
value to a variable named age
.
We can also reassign the value later.
In JavaScript we can declare a variable with the var
, let
, and const
keywords. Let’s briefly take a look at each in the next few lessons…
Nice job! On to the next lesson.