Introduction
We use var to create a named container that holds a value we can use later in our program.
When you want to store a value like a number or text to use later.
When you need to change the value stored in a variable during the program.
When you want to give a name to a value to make your code easier to read.
When you are working with older JavaScript code that uses <code>var</code>.
When you want a variable that is function-scoped rather than block-scoped.