CHAPTER 2

image

Functions

As you learned in the previous chapter, almost everything in JavaScript is an object, including functions. However, functions are much more than just bags for containing properties; they are how work gets done in the language. Typically, developers become aware of the specifics of functions only when something they wrote explodes in their face. My goal in this chapter is to expose the intricacies of JavaScript functions to you, which will hopefully save you from having to pull syntactic shrapnel from your codebase.

A word of caution before I begin: JavaScript is only as good as its interpreter. Although the concepts discussed ...

Get Expert JavaScript 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.