Busy JavaScript Developer's Guide to Functional Programming

ted@tedneward.com | Blog: http://blogs.tedneward.com | Twitter: tedneward | Github: tedneward | LinkedIn: tedneward

Objectives

Functional Programming

What's it mean, exactly?

Concepts

Basic functional concepts

Concepts

Optional functional concepts

Concepts

Immutable values

Values over variables

Concepts

A functional pseudocode example


let x = 0
let y = 1
let z = x + y

Concepts

Functions as first-class values

Concepts

Higher-order functions


let numbers = [1, 2, 3, 4, 5]
let squares = numbers.map((num) -> num * num);
// squares = [1, 4, 9, 16, 25]

Concepts

Partial application

Currying

Concepts

Partial application


let add x y = x + y

let five = add 2 3  // = 5
let addBy2 = add 2  // = (anonymous fn) = 2 + y
let six = addBy2 addBy2 2 // = 6

Concepts

Function composition

Concepts

Strongly-typed

Type-inferenced

Concepts

Recursion

Concepts

Expressions-not-statements

Concepts

Tuples, lists

Concepts

Pattern-matching

Concepts

Laziness

Concepts

Sequences

Summary

Credentials

Who is this guy?