Task: Applicative programming

← Previous task Next task →


Instead of discussing the theory on lexical scoping and closures, we will just go straight to more code. If you want to read the theory, we recommend checking out this link after the workshop: Eloquent JavaScript chapter 3

First up is applicative programming. In general, applicative programming is the pattern of defining a function that takes a function and then invokes that function for each element in a collection. We will look at three central functions: map, filter and reduce. These are central building blocks of what we are learning today.

Applicative programming works best with pure functions, i.e. functions that have no side effects: it references no other mutable state, does not set any values other than the return value, and relies only on the parameters given as input.


  1. Part 0: Introduction to the workshop
  2. Part 1: A functions context
  3. Part 1: A functions arguments
  4. Part 1: Functions and prototypes
  5. Part 2: Applicative programming [Active]
  6. Part 2: Make new collections with map
  7. Part 2: Make new collections with filter
  8. Part 2: Make new collections with reduce
  9. Part 2: Using helper liberaries
  10. Part 2: Point-free style
  11. Part 2: Applicative functions with context
  12. Part 3: Function factories
  13. Part 3: Higher order functions
  14. Part 3: Functions with functions
  15. Part 3: Fluent interfaces
  16. Part 3: Function arity
  17. Part 4: Partial application
  18. Part 4: Create functions from functions
  19. Part 5: Currying
  20. Part 5: Composition
  21. Part 5: Pipelines
  22. Part 5: Case - Parse URL
  23. Part 6: Shared state
  24. Part 7: Working with collections
  25. Part 7: Done
← Previous task Next task →


Available globals