Skip to content

Functional JavaScript Introducing Functional Programming with Underscore. js

Best in textbook rentals since 2012!

ISBN-10: 1449360726

ISBN-13: 9781449360726

Edition: 2013

Authors: Michael Fogus

List price: $23.99
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Description:

While some web developers dismiss JavaScript as a flawed language, this succinct book shows you how to make the best of it by practicing a functional style of JavaScript programming.Written by Michael Fogus—a core contributor to Clojure and ClojureScript, and author of The Joy of Clojure (Manning)—this book is packed with not only the how of functional programming, but also the why. Each topic illustrated with pointed examples. You’ll also get a thorough reference to the Underscore.js library and its idioms, including:ClosuresApplicative programmingLazinessImmutabilityHigher-order functionsPurityCombinatorsCurrying and partial application
Customers also bought

Book details

List price: $23.99
Copyright year: 2013
Publisher: O'Reilly Media, Incorporated
Publication date: 6/18/2013
Binding: Paperback
Pages: 260
Size: 7.28" wide x 9.53" long x 0.56" tall
Weight: 0.902
Language: English

Michael Fogus is software developer with experience in distributed simulation, machine vision, and expert systems construction. He's actively involved in the Clojure and Scala communities.Chris Houser is a primary contributor to Clojure and has implemented several features for the language.

Foreword
Foreword
Preface
Introducing Functional JavaScript
The Case for JavaScript
Some Limitations of JavaScript
Getting Started with Functional Programming
Why Functional Programming Matters
Functions as Units of Abstraction
Encapsulation and Hiding
Functions as Units of Behavior
Data as Abstraction
A Taste of Functional JavaScript
On Speed
The Case for Underscore
Summary
First-Class Functions and Applicative Programming
Functions as First-Class Things
JavaScript's Multiple Paradigms
Applicative Programming
Collection-Centric Programming
Other Examples of Applicative Programming
Defining a Few Applicative Functions
Data Thinking
"Table-Like" Data
Variable Scope and Closures
Global Scope
Lexical Scope
Dynamic Scope
JavaScript's Dynamic Scope
Function Scope
Closures
Simulating Closures
Using Closures
Closures as an Abstraction
Summary
Higher-Order Functions
Functions That Take Other Functions
Thinking About Passing Functions: max, finder, and best
More Thinking About Passing Functions: repeat, repeatedly, and iterateUntil
Functions That Return Other Functions
Capturing Arguments to Higher-Order Functions
Capturing Variables for Great Good
A Function to Guard Against Nonexistence: mull
Putting It All Together: Object Validators
Summary
Function-Building Functions
The Essence of Functional Composition
Mutation Is a Low-Level Operation
Currying
To Curry Right, or To Curry Left
Automatically Currying Parameters
Currying for Fluent APIs
The Disadvantages of Currying in JavaScript
Partial Application
Partially Applying One and Two Known Arguments
Partially Applying an Arbitrary Number of Arguments
Partial Application in Action: Preconditions
Stitching Functions End-to-End with Compose
Pre- and Postconditions Using Composition
Summary
Recursion
Self-Absorbed Functions (Functions That Call Themselves)
Graph Walking with Recursion
Depth-First Self-Recursive Search with Memory
Recursion and Composing Functions: Conjoin and Disjoin
Codependent Functions (Functions Calling Other Functions That Call Back)
Deep Cloning with Recursion
Walking Nested Arrays
Too Much Recursion!
Generators
The Trampoline Principle and Callbacks
Recursion Is a Low-Level Operation
Summary
Purity, Immutability, and Policies for Change
Purity
The Relationship Between Purity and Testing
Separating the Pure from the Impure
Property-Testing Impure Functions
Purity and the Relationship to Referential Transparency
Purity and the Relationship to Idempotence
Immutability
If a Tree Falls in the Woods, Does It Make a Sound?
Immutability and the Relationship to Recursion
Defensive Freezing and Cloning
Observing Immutability at the Function Level
Observing Immutability in Objects
Objects Are Often a Low-Level Operation
Policies for Controlling Change
Summary
Flow-Based Programming
Chaining
A Lazy Chain
Promises
Pipelining
Data Flow versus Control Flow
Finding a Common Shape
A Function to Simplify Action Creation
Summary
Programming Without Class
Data Orientation
Building Toward Functions
Mixins
Core Prototype Munging
Class Hierarchies
Changing Hierarchies
Flattening the Hierarchy with Mixins
New Semantics via Mixin Extension
New Types via Mixin Mixing
Methods Are Low-Level Operations
}).call("Finis�);
Functional JavaScript in the Wild
Annotated Bibliography
Index