Function Graph Overview
    Preparing search index...

    Function pairwise

    • Generates adjacent pairs from an input array.

      Type Parameters

      • T

        The type of elements in the input array

      Parameters

      • items: T[]

        Input array to generate pairs from

      Returns IterableIterator<[T, T]>

      A generator yielding consecutive pairs of elements

      [...pairwise([1, 2, 3, 4])] // [[1,2], [2,3], [3,4]]