What is closure in JavaScript?

Q & ACategory: JavaScriptWhat is closure in JavaScript?
Admin Staff asked 3 years ago

What is closure in JavaScript?

1 Answers
Admin Staff answered 3 years ago

When we need to accessed the variable which is defined outside the current scope. We create a Closures to accessed the variable which is defined outside the current scope and it is accessed from some inner scope.