Go ahead and get use to the wrong way and not define them. You will pay for it in the end.
http://www.howtocreate.co.uk/tutorials/ ... /variablesNormal variables
It is good practice to pre-define all variables using the var keyword. It is possible to define the variable, leaving its value undefined, or assigning a value immediately, or even to define multiple variables in a single command:
var variablename;
var variablename = value;
var vari1 = value, vari2 = anotherValue, vari3;
JavaScript is fairly lenient, and will create a global variable if you forget to use the 'var' keyword, but you assign a value to an undeclared variable (if you attempt to read the value of an undeclared variable, it will throw an error, as discussed below). However, this can lead to problems if you end up accidentally overwriting variables from another scope (this will be covered in the chapter on Functions). Once a variable is defined do not use 'var variablename' again unless you wish to completely overwrite the variable. It makes no sense to redeclare a variable with the var keyword within the same scope, but browsers will not complain if you do it.