Question:
What are the benefits of having global and local variables?
Answer:
Global variables can be called upon any where in the script.local variables are not valid outside the code blocks they are created in. Source: CoolInterview.com
Global variable is accessible any where is the sciript, but local have only be valid in the block,<br>so we can use the local variable to avoid the out side interference. Source: CoolInterview.com