Chapter 11: Further Functions
We covered functions back in chapter 4, but we were only just beginning to scratch the surface. In JavaScript, functions are first-class objects, which means they can be passed around in the same way as every other value. They can have their own properties and methods, as well as accepting other functions as parameters and being returned by other functions. This makes them a very flexible tool to work with in JavaScript, and there are a variety of techniques and patterns that can be used to make code cleaner.
In this chapter, we’ll cover the following topics:
Function properties and methods
Immediately Invoked function expressions
Self-defining functions
Recursive functions
Callbacks
Promises
Async functions ...
Get JavaScript: Novice to Ninja, 2nd Edition 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.