average()

suckgamoni edited this page May 14, 2013 · 1 revision

Determines whether any element of a sequence satisfies a condition.

Syntax

Return Value

Type: number
The average of the sequence of values.


Example

var grades = [ 78, 92, 100, 37, 81 ];

var average = from(grades).average();

console.log("The average grade is " + average);

// This code produces the following output:
//
// The average grade is 77.6.