Scope reffers to extent at which Variables/variable is accesible within a program
There are mainly two types of variables scopes:
In contrast, global variables are variables that are defined outside of functions. These variables have global scope, so they can be used by any function without passing them to the function as parameters.
Global Variable: Since global variables are defined outside there function so variables with the same name can not be used in different functions.
All the scripts and functions on a web page can access it.