3. Working with Functions

Functions are JavaScript’s workhorse, serving simultaneously as the programmer’s primary abstraction facility and implementation mechanism. Functions alone play roles that other languages fulfill with multiple distinct features: procedures, methods, constructors, and even classes and modules. Once you become comfortable with the finer points of functions, you have mastered a significant portion of JavaScript. The flip side of the coin is that it can take some time to learn how to use functions effectively in different contexts.

Item 18: Understand the Difference between Function, Method, and Constructor Calls

If you’re familiar with object-oriented programming, you’re likely accustomed to thinking of functions, methods, ...

Get Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript now with the O’Reilly learning platform.

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