sumBy<T>(@StreamCapable array: Array<T>, numberSelector: (T) -> Number): Number
Returns the sum of the values of the elements in an array.
Parameters
| Name | Description |
|---|---|
|
The input array. |
|
A DataWeave selector that selects the values of the numbers in the input array. |
Example
This example calculates the sum of the values of elements some arrays. Notice
that both of the sumBy function calls produce the same result.