0 points

Javascipt reduce (Objects)


dashboard

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

Posted by @gerardolgvr0310 #javascript

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

>> 15
content_copy Copy

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