In a nutshell
callback() on each element, and returns a new array with the new results.
map() accepts as parameters
- current element — The current element being processed in the array.
- the current element index — The index of the…