• Calls the specified callback function for all the elements in a list. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. ts.reduce But also works with generators.

    Type Parameters

    • T

    • U = T

    Parameters

    • ts: Iterable<T>

      list of things

    • acc: ((acc, t) => U)

      function to accumulate a thing to

        • (acc, t): U
        • Parameters

          • acc: U
          • t: T

          Returns U

    • initial: U

      accumulator start value

    Returns U

    the accumulated total

Generated using TypeDoc