Chapter 4. Wielding functions

This chapter covers

  • Why anonymous functions are so important
  • The ways that functions can be referenced for invocation, including recursively
  • Storing references to functions
  • Using the function context to get our way
  • Dealing with variable-length argument lists
  • Determining whether an object is a function

In the previous chapter, we focused on how JavaScript treats functions as first-class objects, and how that enables a functional programming style. In this chapter, we’ll expand on how to use those functions to solve various problems that we might come across when authoring web applications.

The examples in this chapter were purposefully chosen to expose secrets that will help you to truly understand JavaScript ...

Get Secrets of the JavaScript Ninja now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.