In JavaScript, 'scope' defines where a variable is available within your code, and if it is truly the same variable or a new copy.
When JavaScript is parsed, the whole script forms a 'global lexical environment' (GLE), which all the code sits inside. With each new function that is declared in the GLE, a new 'local lexical environemnt' is created for that function. Code within a functions local lexical environment can only be accessed by other code within that function or any other functions it declares; this is referred to as 'local scope'. 'Global scope' is code that is not defined within a function and is available to all code everywhere.
Think of it as different security levels within an organisation. Everyone within the organisation is granted security clearance level 1 (basic). The people with security clearance level 2 have access to levels 1 & 2. The people with security clearance level 3 have access to levels 1, 2 & 3. When a new function is declared in the initial global environment, it is set at security clearance level 2 and only code within this new function is permitted access. Each time another function is declared within this function, the security clearance level is increased by 1 and only the code within the newly created function is given the new security clearance level.
Scope can be a little confusing at first, but it is extremely helpful as it allows you to use the same variable names within different scopes and prevents one from overwriting the other.
Cheers,