Answers for "map fun in js"

3

javascript map

// make new array from edited items of another array
var newArray = unchangedArray.map(function(item, index){
  return item;	// do something to returned item
});

// same in ES6 style (IE not supported)
var newArray = unchangedArray.map((item, index) => item);
Posted by: Guest on February-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language