September 2024
Beginner to intermediate
985 pages
35h 37m
English
In this section, we’ll show you the advantages of functional programming compared to imperative programming. To do this, we'll introduce four methods available to arrays in JavaScript:
The forEach() method for iterating over arrays (which we discussed in Chapter 4)
The map() method for mapping elements of one array to new elements in another array
The filter() method for filtering elements in an array
The reduce() method for reducing the elements of an array to a single value
If you want to iterate via an array or a list, you have several (imperative) options, which you’ve already learned about in this book (for example, in Chapter 3 ...
Read now
Unlock full access