Lists & arrays
Scalar
array_reduce()
Returns a single value that is the result of applying the lambda function to each element of the input list, starting with the first element and then repeatedly applying the lambda function to the result of the previous application and the next element of the list. When an initial value is provided, it is used as the first argument to the lambda function
Alias of list_reduce()
Arguments & returns
2 overloadsarray_reduce(list, lambda[)
Scalar
| Overload link | list | lambda[ |
Returns |
|---|---|---|---|
| #01 | ANY[] | LAMBDA |
ANY |
array_reduce(list, lambda[, initial])
Scalar
| Overload link | list | lambda[ | initial] |
Returns |
|---|---|---|---|---|
| #02 | ANY[] | LAMBDA | ANY |
ANY |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example · Run to view results.
Catalog examples
SELECT
list_reduce([1, 2, 3], (x, y) -> x + y);