DEV Community

Jawad Ali
Jawad Ali

Posted on

1

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay