Global variables are defined outside the function and they can be called in entire script. Irrespective of the function they are not limited to certain script, Hence naming the Global variables. There is an option to name the same var with different values inside function and outside function. The variable which is named inside function will be limited to the function and considered as local variable where as the variable which is assigned outside function can be accessed from anywhere because it is a global variable. Though this can be done, developers suggest not to use the same name for assigning variables because it will confuse the programmers.
Java script in browsers usually run in Strict mode. In strict mode the variables which are written outside function and not assigned value are not considered as global variables. Variables must certain value to be considered as global variables.