What Is Scope?
Variables inside the global scope can be accessed and altered in any other scope.
There is typically one global scope and each function defined has its own local scope. Any function defined with in another function has a local scope of the parent function.
If I create function and defined some variables, those variable will be the local variables of that function. Take an example –
If we assign a value to a variable that has not been declared then that variable will be considered as Global Variable.