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.

ImageCollection.iterate(algorithm, first)ComputedObject
this: collectionCollection

The Collection instance.


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.