JavaScript Function Closures

JavaScript variables can be local or global variables based on function closures. Global and local variables with the same name are different variables.

Code :