The final consideration when creating a variable is how long that you want it to continue to exist. Variables can either local or global depending on how they are defined.
Exactly where the definitions make a difference is beyond the scope of this introductory series. For the moment it is sufficient for you to know that using local variables everywhere except where you specifically need a variable to be global reduces the chance of name conflicts between like named variables being used for different purposes by different scripts on the same page.
This article written by Stephen Chapman, Felgall Pty Ltd.