© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
J. BartlettProgramming for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-8751-4_14

14. Manipulating Functions and Scopes

Jonathan Bartlett1  
(1)
Tulsa, OK, USA
 

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 ...

Get Programming for Absolute Beginners: Using the JavaScript Programming Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.