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

Functions defined at the top level of your code have global scope, whereas functions defined within another function have local scope

From

Cover of Head First JavaScript Programming

Note

What is the scope of each type of function?