In Chapter 10, we learned about functions and how they create local scopes. Chapter 13 went into further depth about how the JavaScript program stack helps JavaScript keep track of where it is in the program and what local scope to use. In this chapter, we are going to go deeper and show how functions can be passed as parameters and returned as values and how to generate new functions that inherit from a different scope than the global scope.
14.1 Functions as Parameters to Functions
Throughout ...