Method to the Madness
Functional Foundations
The Function Formerly Known as…
Curry Up and Answer
Reduce, Reuse, Recurse
100

Creates a new array by applying a function to every element in the original array.

What is map?

100

This term refers to writing code that does not change the original data.

What is immutability?

100

This compact syntax for writing functions was introduced in ES6 and does not bind its own `this`.

What is an arrow function?

100

Currying transforms a function that takes multiple arguments into this.

What is a sequence of functions that each take one argument?

100

The reduce() method takes this kind of function and applies it to each element in an array.

What is a reducer function?

200

Executes a provided function once for each array element but does not return anything

What is forEach?

200

This type of function always produces the same output for the same input.

What is a pure function?

200

A function that is passed into another function as an argument.

What is a callback function?

200

This JavaScript property tells you how many parameters a function is defined to accept.

What is fn.length?

200

You can use reduce to sum all numbers in an array by using this type of initial value.

What is 0 (zero)?

300

Returns a portion of an array without modifying the original. It takes a start and an optional end index.

What is slice?

300

These types of functions can be passed as arguments, returned from other functions, and assigned to variables.

What are first-class functions?

300

This feature allows an inner function to “remember” and access variables from its outer function.

What is a closure?

300

If a curried function is called with fewer arguments than needed, it returns this.

What is another function that takes the remaining arguments?

300

If no initial value is provided to reduce(), it uses this as the starting value for the accumulator.

What is the first element of the array?

400

Creates a new array with only the elements that pass a test implemented by the provided function.

What is filter?

400

This term describes functions that either take other functions as arguments or return them as results.

What are higher-order functions?

400

This is the number of parameters a function is declared to accept.

What is arity?

400

In a curry helper, this is the step that repeatedly returns a new function.

What is the recursive step?

400

This metaphor typically describes how reduce transforms an array into a single value.

What is folding?

500

Can return any data type as a single result by accumulating values through a callback function.

What is reduce?

500

This term refers to anything a function does besides returning a value, such as modifying external variables or logging to the console.

What are side effects?

500

Transforming a function with multiple arguments into a sequence of functions that each take one argument.

What is currying?

500

This concept describes when you pre-fill some arguments of a function.

What is partial application?

500

Using reduce this way allows you to transform a nested array [[1,2],[3,4]] into [1,2,3,4] in one go.

What is flattening?