- sum<S, T>(addends, property): number
Type Parameters
- S extends string | number | symbol
- T extends {
[s in string | number | symbol]: number
}
Parameters
- addends: readonly T[]
- property: S
Returns number
Sum of numbers
- sum<T>(addends, mappingFunction): number
Parameters
- addends: readonly T[]
- mappingFunction: ((element: T) => number)
- (element): number
Returns number
Returns number
Sum of numbers
Sum an array of numbers.
Param: addends
Addends to sum.
Param: x
Property or mapping function of addends to sum
Returns
Sum of numbers