• Maps each sliding window of elements in the array to a new value.

    Type Parameters

    • T

      The type of elements in the items array.

    • R

      The type of the elements returned by the function.

    Parameters

    • items: T[]

      The array of items to process.

    • fn: ((items, start, collection) => R)

      The function to apply to each sliding window that returns a new value.

        • (items, start, collection): R
        • Parameters

          • items: T[]
          • start: number
          • collection: T[]

          Returns R

    • Optional options: {
          increments: undefined | number;
          start: undefined | number;
          windowSize: undefined | number;
      } = {}

      The options for sliding window (start index, window size, and increments).

      • increments: undefined | number
      • start: undefined | number
      • windowSize: undefined | number

    Returns R[]

    • An array of results produced by the mapping function.

Generated using TypeDoc