- Access to its own scope, i.e., the variable defined within its curly braces.
- Access to the variables of the outer functions.
- Access to the global variables.
This is usually done using nested functions where the outer function exits and either returns a function, or declares a function which outlives it. This inner function then has references to the variables and parameters declared within the outer function , even though those variables are no longer in scope.