Javascript Array map(mappingRelation)

Description

Javascript Array map(mappingRelation)

Array.prototype.map = function(mappingRelation){
 return this.reduce(function(accumulator, value){
  return accumulator.concat(mappingRelation(value));
 }, []);//  w w w  . java2  s  . c  om
}



PreviousNext

Related