ts-iterable-functions
    Preparing search index...

    Function headTail

    • Returns a tuple containing the first element of the given iterable and a new iterable for the remaining elements.

      Type Parameters

      • T

        The type of elements in the source iterable.

      Parameters

      • src: Iterable<T>

        The source iterable to extract the head and tail from.

      Returns readonly [T, Iterable<T, any, any>]

      A readonly tuple where the first element is the head (first item) and the second element is an iterable of the tail (remaining items).

      If the source iterable is empty.