Collection extensions

sum

collection · standard futureprog, computer function, computer program

Returns: Number

The SUM function runs the inner function (which itself returns a number) over all elements of the collection, and then returns the sum of the results. Will return 0 if the collection is empty.

Note: If the collection itself is a collection of numbers, you can use the pattern .Sum(x, @x)

← Back to Collection extensions