However, just because JavaScript's variables are easy to use doesn't mean they lack power. By Gordon McComb rogramming languages are next to useless without variables. These special information-holding areas can store numbers, text strings, objects, and other data types. Once stored, this information can be used later in your program. With a variable, a person's name could be stored and used at some point in the script.
Variables are temporary holders of information.
In addition, the contents of a variable are erased when you assign a new value to them. Though a variable created in one document script is not usually seen by another document script, JavaScript does provide ways to share variables between scripts. You do this by referencing the name of the document along with the name of the variable. The first argument is the name of the variable. Variable names can be very long, but you are restricted in the characters you may use.