Javascript: When to use map function of array?

When you grow up in programming using for loops, it’s quite confusing when to use the map function.