From the classic
forloop to the
.map() creates an array from calling a specific function on each item in the parent array.
.map() is a non-mutating method in that it creates a new array as against mutating methods which only make changes to the calling array. This can be tricky to remember.
In this post, we’ll look at