A closure is created when a function is defined within another function and has access to its parent function’s variables.
Unfortunately, this isn't really correct. A closure is created EVERY time a function is created, regardless of whether it was inside another function. You also imply that a closure is a function - which is also incorrect.
Unfortunately, this isn't really correct. A closure is created EVERY time a function is created, regardless of whether it was inside another function. You also imply that a closure is a function - which is also incorrect.
Misconceptions About Closures
Jon Randy 🎖️ ・ Sep 27
Thanks @jonrandy ... I will update.