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!