ee.List.reduce
Apply a reducer to a list. If the reducer takes more than 1 input, then each element in the list is assumed to be a list of inputs. If the reducer returns a single output, it is returned directly, otherwise returns a dictionary containing the named reducer outputs.
Usage | Returns |
---|
List.reduce(reducer) | Object |
Argument | Type | Details |
---|
this: list | List | |
reducer | Reducer | |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-05 UTC.
[null,null,["Last updated 2024-06-05 UTC."],[[["`List.reduce` applies a given reducer function to a list, processing each element individually or as a list of inputs for the reducer."],["The method returns a single output directly if the reducer produces one, otherwise it returns a dictionary containing named outputs from the reducer."],["This function operates on a list and requires a reducer as input, streamlining the application of reducing functions to list data."]]],["A `reducer` function is applied to a `list`. If the `reducer` accepts multiple inputs, each list element is treated as a list of inputs. The output depends on the `reducer`: a single output is returned directly, whereas multiple outputs are returned as a dictionary with named outputs. The `list.reduce(reducer)` method is employed, returning an object. The method takes two arguments, a `list` and a `reducer`.\n"]]