sum()

suckgamoni edited this page May 15, 2013 · 1 revision

Computes the sum of a sequence.

Syntax

Return Value

The sum of the values in the sequence.


Example

var numbers = [ 43.68, 1.25, 583.7, 6.5 ];
var sum = from(numbers).sum();

console.log("The sum of the numbers is " + sum);

/*
 This code produces the following output:

 The sum of the numbers is 635.13.
*/