has a global scope – identical with the global object – window in browsers, global in node, self in a worker… • Local variables are declared with "var" and are scoped to the function they are declared within • Function declarations (but not expressions) produce local bindings, and have priority over var in the same scope • When a variable is accessed (declared or not), JS resolves it by looking in the current scope for a variable with that name – If it fails to find one, it looks through the enclosing scopes in order from innermost to global – As soon as it finds a variable with that name it stops and uses that one • If it doesn't find any variable by the end, it produces a ReferenceError (for reads) or "accidentally" (implicitly) creates a global variable (for writes) • As a consequence, if an outer scope variable is "shadowed" by a closer (inner) variable of the same name, the outer will not be accessible by scope resolution