arrayReduce function

String arrayReduce(
  1. List array,
  2. Function iteratee,
  3. String accumulator, [
  4. bool initAccumulator = false,
])

Implementation

String arrayReduce(List array, Function iteratee, String accumulator,
    [bool initAccumulator = false]) {
  int index = -1;
  final length = array.length;

  if (initAccumulator && length > 0) {
    accumulator = array[++index];
  }
  while (++index < length) {
    accumulator = iteratee(accumulator, array[index], index);
  }
  return accumulator;
}