Akash
Apr 27, 2025
What is closure in javascript?

Recently learned about closure in javascript, wanted to know more about it

1 Answers
Recent Answers
Kane
Sep 6, 2025

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives a function access to its outer scope. In JavaScript, closures are created every time a function is created, at function creation time.