JavaScript variables can belong to:
The local scope or The global scope
Global variables can be made local (private) with closures.
Closures makes it possible for a function to have “private” variables.
Local Variables
A local variable is a “private” variable defined inside a function.
A function
can access all variables in the local scope. Continue reading JavaScript Closures