collections.Seq: Specify max slice size

This commit is contained in:
Joe Mooring
2023-12-31 12:35:39 -08:00
committed by GitHub
parent e24d81a4b7
commit 5058bc5201
+4 -8
View File
@@ -21,7 +21,7 @@ aliases: [/functions/seq]
{{ seq -2 2 2 }} → [-2 0 2]
```
Iterate over a sequence of integers:
A contrived example of iterating over a sequence of integers:
```go-html-template
{{ $product := 1 }}
@@ -31,10 +31,6 @@ Iterate over a sequence of integers:
{{ $product }} → 24
```
The example above is contrived. To calculate the product of 2 or more numbers, use the [`math.Product`] function:
```go-html-template
{{ math.Product (seq 4) }} → 24
```
[`math.Product`]: /functions/math/product
{{% note %}}
The slice created by the `seq` function is limited to 2000 elements.
{{% /note %}}