If we want to add mapping to basic JS data types, let's start by considering our options:
- With null, undefined, and Symbol, applying maps doesn't sound too interesting
- With the Boolean, Number, and String data types, we have some interesting possibilities, so we can examine some of those
- Applying mapping to an object would be trivial: you just have to add a .map() method, which must return a new object
- Finally, despite not being basic data types, we could also consider special cases, such as dates or functions, to which we could also add .map() methods
As in the rest of the book, we are sticking to plain JS, but you should look into libraries such as LoDash, Underscore, or Ramda, which already provide functionalities ...