DEV Community

Discussion on: JavaScript Basics-Closures

Collapse
z00md profile image
z00md

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

Collapse
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.