JS Var

Variable declarations, wherever they occur, are processed before any code is executed. The scope of a variable declared with var is its current execution context, which is either the enclosing function or, for variables declared outside any function, global. If you re-declare a JavaScript variable, it will not lose its value.

var favFood = 'Pizza'; var favNumber = 37;

You can also declare and initialize multipe variable in one line

var favFood = 'Pizza', favNumber = 37;

Also you can assign two variable with the same single string value

var a = 'A'; var b = a;