JavaScript in 60 Seconds


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.

var age = 31; // How old will Bob be in 30 years? age + 30;

Here we assigned a number value to a variable named age.

We can also reassign the value later.

var name = "Adam"; // a string name = "Bill"; // oops, wrong name. Let's fix that. name;

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.