DEV Community

Jawad Ali
Jawad Ali

Posted on

Map Function In Javascript and What are It's Keypoints

Map function is used to display whole index of an array but it can not display object in return that's why because it is always used with an array.
for exapmle:
const array = ['Jawad','Ali']
// we can represent index of array like:
console.log(array[0])
// If we want to print the whole array then we use map method:
array.map((arr) => {
console.log(arr)
// This will print whole indexes from array
})

Top comments (0)