DEV Community

Discussion on: JavaScript Basics-Closures

z00md profile image

Just curious, why does closure exist? What if it is removed from the language?

devdebarshi profile image
Debarshi Bhattacharjee Author

They help us to implement some key features in JS such as Data Hiding and Module Pattern. Hooks in React was possible due to Closures. I'll surely write another post on advantages and usage of closures.