sum source npm

_.sum(array)

Gets the sum of the values in array.

Arguments

  1. array (Array)

    The array to iterate over.

Returns (number)

Returns the sum.

Example

_.sum([4, 6]);
// => 10