Chapter 2. Functions

One of JavaScript's best features is the language's implementation of functions. Whereas other languages present different function types for different purposes, JavaScript only has one function type that covers all use cases—from subroutines to lambdas to object methods.

A JavaScript function may look simple on the outside but don't be fooled—the architecture that hides underneath a basic function declaration is quite complex. And while topics like function forms, scope, context, and function execution may seem too complicated for practical consideration, learning about these details that usually go unnoticed improves your knowledge of the language and provides you with an arsenal to solve even the most complex of problems. ...

Get Pro JavaScript with MooTools: Learning Advanced JavaScript Programming 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.