[Solved] sum all values of an object in an array of objects javascript


Use Array.reduce to calculate the sum

const sum = array.reduce((acc, o) => acc + parseInt(o.value), 0)

2

solved sum all values of an object in an array of objects javascript