JavaScript map can be used when you want to perform an action on each element in a collection, and gather the results into a new array.
Imagine we have an array like this: -
const Arr= ['java','nodejs','nestjs','php']
And we need to access this element one by one and do something and return a new array. This is how we do that in a javascript map