• Applies a callback function to each pair of elements in an array.

    Type Parameters

    • T

      The type of the elements in the array.

    • R

      The type of the result returned by the callback function.

    Parameters

    • items: T[]

      An array of elements.

    • cb: ((a, b, i, j, items) => R)

      A callback function that takes two elements, their indices, and the original array as arguments and returns a result.

        • (a, b, i, j, items): R
        • Parameters

          • a: T
          • b: T
          • i: number
          • j: number
          • items: T[]

          Returns R

    Returns R[]

    An array of results obtained by applying the callback function to each pair of elements.

Generated using TypeDoc