In this chapter, we started working with higher-order functions in order to show a more declarative way of working, with shorter, more expressive code. We went over several operations: we used .reduce() and .reduceRight() to get a single result from an array, .map() to apply a function to each element of an array, .forEach() to simplify looping, flat() and flatMap() to work with arrays of arrays, .filter() to pick elements from an array, .find() and .findIndex() to search in the arrays, and .every() and .some() to verify general logic conditions. Furthermore, we considered some unexpected situations that happen when you deal with async functions and we wrote special functions for those cases.
In Chapter 6, Producing Functions – Higher-Order Functions...