Design Patterns · Middle · Question 71 of 75

What is a collection pipeline?

orders.filter(isPaid).map(toTotal).reduce(sum, 0)

Explanation

Each step is easy to name and test. For huge data, lazy iterators avoid creating intermediate arrays.

Further reading

Problem with a question

Design Patterns · Middle · question 71

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz