Skip to content

Latest commit

 

History

History

map-method

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

JavaScript - Map method

Map is one of the methods to traverse the arrays.

It will be used to return the updated values of an array by not changing the original array.

It will take callback as input and selects the elements to update and returned based on the expression inside the callback.

The callback function would be excuted for every element of the array.

  • Syntax:
    const newArray = Array.map((parameter) => {
        return // updattion expression;
    });