Lists & arrays
Scalar
reduce()
Reduces all elements of the input list into a single scalar value by executing the lambda function on a running result and the next list element. The lambda function has an optional initial_value argument.
Alias of list_reduce()
Arguments & returns
2 overloadsreduce(list, lambda(x,y))
Scalar
| Overload link | list | lambda(x,y) |
Returns |
|---|---|---|---|
| #01 | ANY[] | LAMBDA |
ANY |
reduce(list, lambda(x,y), initial_value)
Scalar
| Overload link | list | lambda(x,y) | initial_value |
Returns |
|---|---|---|---|---|
| #02 | ANY[] | LAMBDA | ANY |
ANY |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example · Run to view results.