Now that you know how to use the
map() function, you’ll review why you might want to use it. You can use this function to write your code in a functional way to input an immutable data structure and define the transformations you want to make, in a declarative way.
When you take this approach, you have a series of steps that are independent from each other and don’t modify your data set. This allows you to keep adding more steps to your program, avoid side effects, and ensure that your data set is still usable.