Global Variables

By: Dusty Arlia
Published on Wednesday, April 17, 2013, 10:36 PM
Last Updated on Friday, July 10, 2015 at 1:19 AM
Total Updates: 2

Global variables are variables that are declared at the top-level. This makes your variables visible throughout your whole JavaScript program. What this means is that you can access your variable anywhere in your program. You can retrieve its value or set it to some other value. Global variables are actually properties of the global object, but cannot be deleted. Variables created with the var keyword cannot be deleted, whereas other global properties can be deleted.

Comments:

Ad: