ArrayExtensions.Reduce<TElement, TSum>

Extension Method in ArrayExtensions

Declaration

public static TSum Reduce<TElement, TSum>(this TElement[] array, TSum initialValue, ArrayExtensions.Reducer<TSum, TElement> reducer)

Description

Reduces the elements of the array to a single value.

Type Parameters

TElementThe type of elements in the array.
TSumThe type of the reduced value.

Parameters

arrayThe array to reduce.
initialValueThe initial value to use.
reducerThe reducer to use.

Returns

TThe reduced value.