Questions about closure in Javascript

Asked

Viewed 21 times

0

Doubt:

Hello, everyone. I’m making some progress in my Javascript studies, however, I have found it difficult to understand what it is closure. I found some websites and books that define closure is an internal function that has access to the variables and parameters of the external function to it. Others, explain that closure is the mode (not the function itself) as the internal function can 'close over' (close-ups over) certain variables. Some sources also point to the existence of closure even without use of function.

This has given me a lot of headache. Can anyone give me a simple explanation of what closure is? Thanks in advance!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.