Javascript Array map() for Junior

What is map() function?
Map is a collection of elements where each element is stored as a Key, value pair. The map() method is used to apply a function on every element in an array. A new array is then returned.
Array.map function has following signature:
arr.map(function callback(currentValue[, index[, array]])
Example:
newArr
— the new array that is returnednumber
— the array to run the map function onval
— the current value being processedindex
— the current index of the value being processedarr
— the original array
map() Vs for loop
Map works same as the for loop the only difference is that map() returns a new array where as for loop change the exiting array or collect elements in a new array.
Example:
Example of map() function
Example 1: Convert array of object to string using map()
Return list of student names from an array of objects representing student information.