Chapter 11Functional JavaScript

Functional programming uses functions as the building blocks of a program and avoids changing the state of data. This means that a program becomes a sequence of expressions based on the return values of functions. The return value of a function should only depend on the values provided as arguments.

Functional programming has gained momentum in recent years with a dedicated following. The popularity of purely functional languages such as Clojure, Scala, and Erlang sparked an interest in functional programming techniques that continues to grow. JavaScript has always supported functional-style programming due to functions being first-class objects. This facilitates some of JavaScript’s most interesting techniques—such ...

Get JavaScript: Novice to Ninja 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.