DEV Community

Discussion on: Understanding Javascript Closures

Collapse
 
casperns profile image
Zelimir Stefanovic

Nice post and how I look at Closures:

When the main function is executed and some variables are assigned a return function,
even later by calling the returned function, we can access the variables that was in the call when the return function returned.

After the execution of the main function, the Scope chain is kept and referred to and is considered to be the parent of the function that is returned and which will be later called.