Variable Scope in JavaScript
The scope of a variable is the region of your program in which it is defined. For example, a global variable has global scope and can be accessed anywhere in your script. A variable defined in a function cannot be accessed outside the function it was created.
Leave a Reply