Understanding the JavaScript Closures

Understanding the JavaScript Closures

What is a closure?

A closure is an inner function that has access to the outer/enclosing function’s variables scope chain.
Closure has three scope chains i.e.,
1) It has access to its own scope (variables defined