JavaScript Map() Overview At a Glance

In this JavScript tutorial i will discuss about JavaScript map() function. The JavaScript map() method create a new array with the result of calling a provided function on every element in the calling array.

Map() calls a provided callback function once for each element in an array and return a new array from the result. If you don't understand the above quote then see the JavaScript map syntex.


Syntex :- map(callback(currentValue, index, array), arg);


See the below example of JavaScript map

var arr = [10, 20, 30, 40, 50];
var newArray =, index) {
    return value;


If you run this code it will return



See another example of javascript map() function

var arr = [{
        price: "100",
        Model: "Primo"
        price: "300",
        Model: "A 50"

var newArray = {
    return value.price;



Output of this code



Hope it can help you.


Facebook Github
A web enthusiastic, a self-motivated full-stack software engineer from Dhaka, Bangladesh with experience in developing applications using Laravel , React and Vue js