The var statement is used to declare a variable, and outside of a function its use is optional.
While a variable can be declared simply by assigning it a value, it is good practice to use var as there are two cases in functions where it is necessary:
var i;
var i = 0, x, max = 57;
You can also declare more than one variable and, optionally, assign values at the same time.