Aggregator methods return a single value calculated from all the elements in a sequence. the aggregator methods include Count
, Sum
, Min
, Max
, Average
, and Aggregate
.
This sample uses Average
to get the average of all numbers in an array.
This sample uses Average
to get the average length of the words in the array.
This sample uses Average
to get the average price of each category's products.
This sample uses Aggregate
to create a running product on the array that calculates the total product of all elements.
This sample uses Aggregate
to create a running account balance that subtracts each withdrawal from the initial balance of 100, as long as the balance never drops below 0.
Next: Sequence operations » Previous: Aggregates-Min »