ee.FeatureCollection.iterate

Applies a user-supplied function to each element of a collection. The user-supplied function is given two arguments: the current element, and the value returned by the previous call to iterate() or the first argument, for the first iteration. The result is the value returned by the final call to the user-supplied function.

Returns the result of the Collection.iterate() call.

UsageReturns
FeatureCollection.iterate(algorithm, first)ComputedObject
ArgumentTypeDetails
this: collectionCollection

The Collection instance.

algorithmFunction

The function to apply to each element. Must take two arguments: an element of the collection and the value from the previous iteration.

firstObject, optional

The initial state.

Examples

JavaScript

// Your example goes here!

Python

# Your example goes here!