The map() method is used to get a modified version of the array or a reduced value using callback functions. map() applies a function to each array element and creates a new array of the returned values
Example :1
const listArray = [1,2,3,4,5]
const listArray = listArray.map(Item => {
return item * 2;
})
console.log(listArray);
Output : [2,4,6,8,10]
Comments
Post a Comment