summaryrefslogtreecommitdiff
path: root/docs/src/reference
diff options
context:
space:
mode:
authorSekoiaTree <51149447+SekoiaTree@users.noreply.github.com>2023-04-25 11:18:27 +0200
committerGitHub <noreply@github.com>2023-04-25 11:18:27 +0200
commitefad1e71fa699e0d2413d3a6a3ce5a4163e38112 (patch)
tree64dd37c540989e71408ee005abdccdb523d76618 /docs/src/reference
parent12129f01707a3389ef90a4c78a872e1c7897a752 (diff)
Add sum and product to arrays (#966)
Diffstat (limited to 'docs/src/reference')
-rw-r--r--docs/src/reference/types.md14
1 files changed, 14 insertions, 0 deletions
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.