Learn JavaScript
Advanced JavaScript
25.1
Lesson

var

A variable is used to store a value.

We can also use var to create a variable and store a value in it.

In the example below, we use var to create the variables name and age. The variable name stores the text Sam Smith and the variable age stores the number 32.