Javascipt reduce (Objects)


PHOTO EMBED

Fri Oct 23 2020 02:34:31 GMT+0000 (UTC)

Saved by @gerardolgvr0310 #javascript

[{value:5}, {value:10}].map(item => item.value).reduce((previousValue, currentValue) => {return previousValue + currentValue })

>> 15
content_copyCOPY

https://stackoverflow.com/questions/15748656/javascript-reduce-on-object