Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

map in javascript

//map is higher order function 
const names= ["Shirshak","SabTech","Fiverr"]
const newNames= names.map(function(name){
 console.log(video)
})
console.log(newVideos) //(3) [undefined, undefined, undefined]
//map always try to return somethings if we don't return we get undefined.

//map is used for modification,copy of array.
//copy of array using map
const newNames= names.map(function(name){
return name;
})
Source by github.com #
 
PREVIOUS NEXT
Tagged: #map #javascript
ADD COMMENT
Topic
Name
2+6 =