Are JavaScript functions like map
The .map function returns an array in the same length with the one it’s called upon. If you want to use the .map function as an iterator in order to access the array items sequentially and modify an entity of outer scope; that’s possible. However .map is not there for its side effects. You should be using the .forEach method for this purpose. I`d like to suggest check more information about javascript map