Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 newArray2 = unchangedArray.map((item, index) => item);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #map
ADD COMMENT
Topic
Name
4+2 =