DEV Community

Cover image for JS interview in 2 minutes / Closure

JS interview in 2 minutes / Closure

Nick K on May 17, 2021

Question: Explain closures in JavaScript. Quick answer: It is a feature of JavaScript which allows you to access the context of the outer function...
Collapse
 
amt8u profile image
amt8u

I assume currying and private variables werent there when JS was invented. But closure was an inherent feature. What was the original use case for closures?