DEV Community

TCZ
TCZ

Posted on

JavaScript closure

I've read posts by several authors who patiently and kindly try to explain to me what a closure is. I can follow their logic. However, because the explanations are lengthy, I'm not satisfied with the fact that I can't pin down the concept with a few words. And I found it somewhat confusing when trying to delineate a closure's relationship with a scope.

The concept of closure becomes much clearer to me after encountering a sentence written by MDN:

"a closure gives you access to an outer function’s scope from an inner function"

I feel that there may be more to what a closure is, but the description above will be a solid point of departure and return. Cheers to precise and concise explanations!

Top comments (0)