O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

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.

From

Cover of Head First JavaScript Programming

Note

What is the difference between the function that is global and the function that is defined in another function?