January 2020
Intermediate to advanced
470 pages
11h 13m
English
What we did in the previous section does work and can be used with no problems. However, we would like to consider a more general solution that we can apply to any data type. Since not all things in JavaScript provide the desired map() method, we will have to either extend the type (as we did in the previous section) or apply a design pattern that we considered in Chapter 11, Implementing Design Patterns – The Functional Way: wrapping our data types with a wrapper that will provide the required map() operations.
In particular, we will do the following: