Skip to main content

sum

_.sum(array) # Ⓢ [Ⓣ][1] Ⓝ

Computes the sum of the values in array.

Since​

3.4.0

Arguments​

  1. array (Array): The array to iterate over.

Returns​

(number): Returns the sum.

Example​

_.sum([4, 2, 8, 6]);
// => 20