I have read several tutorials about closures. Some tutorials have some information about execution context. I am confused that execution context and closure seem to the same thing.Does anyone can explain this?
Closures are functions which remember the environment they were created in. https://developer.mozilla.org/en/docs/Web/JavaScript/Closures
Closures keep the reference to the lexical context where they are created. Check this to know more about lexical context: Lexical environment and function scope. When the closures(functions) are executed, they are executed in execution context. So,
Closures => function, Execution context => environment
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With