Map e Reduce em JavaScript - Post http://localhost8080.blogspot.com.br/2015/10/map-e-reduce-em-javascript.html
// map | |
var idList = list.map(function(entity) { | |
return entity.id; | |
}); | |
// reduce | |
var valueTotal = list.reduce(function(valueTotal, entity) { | |
return valueTotal + entity.value; | |
}, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment