function flattenReduce(geojson, callback, initialValue) {
  var previousValue = initialValue;
  flattenEach(
    geojson,
    function (currentFeature, featureIndex, multiFeatureIndex) {
      if (
        featureIndex === 0 &&
        multiFeatureIndex === 0 &&
        initialValue === undefined
      )
        previousValue = currentFeature;
      else
        previousValue = callback(
          previousValue,
          currentFeature,
          featureIndex,
          multiFeatureIndex
        );
    }
  );
  return previousValue;
}
Reduce flattened features in any GeoJSON object, similar to Array.reduce().

@name flattenReduce
@param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object
@param {Function} callback a method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex)
@param {*} [initialValue] Value to use as the first argument to the first call of the callback.
@returns {*} The value that results from the reduction.
@example
var features = turf.featureCollection([
    turf.point([26, 37], {foo: 'bar'}),
    turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})
]);

turf.flattenReduce(features, function (previousValue, currentFeature, featureIndex, multiFeatureIndex) {
  //=previousValue
  //=currentFeature
  //=featureIndex
  //=multiFeatureIndex
  return currentFeature
});