Find the sum of an array.
An array.
Optional
The iteratee invoked on each element.
Returns the sum.
0.1.0
sum([1, 2, 3])// => 6const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]sum(objects, ({ n }) => n)// => 20 Copy
sum([1, 2, 3])// => 6const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]sum(objects, ({ n }) => n)// => 20
Find the sum of an array.