the only difference between a function defined at the top level of your code and one that’s defined within another function is just a matter of scope. In other words, placing a function in another function affects where the function is visible within your code.
- 11. Anonymous Functions, Scope and Closures: Serious functions
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
What is the difference between the function that is global and the function that is defined in another function?