Skip to content

Variable Scope

Marie-Louise edited this page Sep 21, 2018 · 4 revisions

The concept of variable scope means that the variable is controlled depending on the location that the variable is declared

scope is the context in which a variable can be accessed, such as within a function, or within the global scope of the whole program - Treehouse

JavaScript has two scopes - global & local

Before ECMAS2015 Variables declared inside a function (locally) have what is described as Function Scope .Local variables can be accessed ONLY inside the function.

global scope

Clone this wiki locally