Chapter 3. First-class functions for the novice: definitions and arguments

This chapter covers

  • Why understanding functions is so crucial
  • How functions are first-class objects
  • The ways to define a function
  • The secrets of how parameters are assigned

You might be surprised, upon turning to this part of the book dedicated to JavaScript fundamentals, to see that the first topic of discussion is functions rather than objects. We’ll certainly be paying plenty of attention to objects in part 3 of the book, but when it comes down to brass tacks, the main difference between writing JavaScript code like the average Jill (or Joe) and writing it like a JavaScript ninja is understanding JavaScript as a functional language. The level of sophistication of ...

Get Secrets of the JavaScript Ninja, Second 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.