SCOPING
A topic that leads to much confusion is that of scoping, and how to control it. Scoping is the process of resolving a variable name when it is encountered in a script. Normally, local variables are searched for the given variable name, if any, followed by global variables. The JavaScript with statement is the most common way to alter scoping. The various scoping rules and issues will now be examined.