Closure in JavaScript
Introduction Closure is an important concept in JavaScript. It happens when a function remembers and can access variables from the scope where it was created, even after the outer function has finished executing. In simple words, a closure allows an inner function to remember and access variables from its outer scope. What is Closure? Consider this example: function outer () { let name = "…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.