Global Scope

Scope is also often referred to as Execution Context.
The area outside of all functions is considered to be global scope.
Anything declared in the global scope can be accessed and modified from any scope.


var global1;          // global scope 
function myfinc() {
   var local1; // local scope
}

Local Scope

If a declaration is not in the global scope then it is run in local scope
There are two types of local scope: Function scope and Block scope




© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext