Function unzipWith

  • This method is like unzip except that it accepts iteratee to specify how regrouped values should be combined. The iteratee is invoked with the elements of each group: (...group).

    Type Parameters

    • T
    • S

    Parameters

    • array: T[][]

      The array of grouped elements to process.

    • iteratee: ((...value: T[]) => S)

      The function to combine regrouped values.

        • (...value): S
        • Parameters

          • Rest...value: T[]

          Returns S

    Returns S[]

    Returns the new array of regrouped elements.

    3.8.0

    const zipped = zip([1, 2], [10, 20], [100, 200])
    // => [[1, 10, 100], [2, 20, 200]]

    unzipWith(zipped, add)
    // => [3, 30, 300]