From efad1e71fa699e0d2413d3a6a3ce5a4163e38112 Mon Sep 17 00:00:00 2001 From: SekoiaTree <51149447+SekoiaTree@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:18:27 +0200 Subject: Add sum and product to arrays (#966) --- docs/src/reference/types.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs') diff --git a/docs/src/reference/types.md b/docs/src/reference/types.md index f5f7e6e4..24756422 100644 --- a/docs/src/reference/types.md +++ b/docs/src/reference/types.md @@ -630,6 +630,20 @@ Folds all items into a single value using an accumulator function. and one for an item. - returns: any +### sum() +Sums all items (works for any types that can be added). + +- default: any (named) + If set and the array is empty, sum will return this. +- returns: any + +### product() +Calculates the product all items (works for any types that can be multiplied) + +- default: any (named) + If set and the array is empty, sum will return this. +- returns: any + ### any() Whether the given function returns `{true}` for any item in the array. -- cgit v1.2.3