I understand what closures are, but I am having some trouble grokking exactly what the term closure
refers to. I have seen the term used in many websites, but rarely do they agree on the actual definition of it.
- Is it the variables that are kept on the stack frame?
- Is it the function that is being returned?
- Is it the scope of the outer function?
- Is it the scope of the inner (returned) function?
- Is it maybe the concept of keeping the variables on the stack-frame after returning the function?
Can someone tell me exactly to what closure
refers to?