JavaScript Array map()
In this Tutorial, we will learn about JavaScript Array map() method with the help of following below:
The map() method creates a new array with the results of calling a provided function on each element in the calling array.
Syntax
var new_array =
current_array.map(function(currentItem, index, array)
{
//Application Logic to current array items
//return items for new array
})
Example1-
Output
Exaple2- Mapping an array of numList to an array of square roots
Output