Can anybody explain why this returns NaN (chrome)?
[{value:1}, {value:2}].reduce((a,b)=>a.value+b.value, {value:0})
or
[{value:1}, {value:2}].reduce((a,b)=>a.value+b.value, 0)
removing the initial value param will work properly:
[{value:1}, {value:2}].reduce((a,b)=>a.value+b.value)
Or instead, using a map will work as expected:
[{value:1}, {value:2}].map(e=>e.value).reduce((a,b)=>a+b, 0)