JavaScript Array.map()
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
JavaScript Array.filter()
In this tutorial, you will learn about Array filter() for filtering of array element with help of examples:
Example1
Output
Example
Output