O'Reilly logo

JavaScript: Novice to Ninja, 2nd Edition by Darren Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required