Documents for @litert/utils-array
    Preparing search index...

    Function toChunks

    • Split an array into chunks, each chunk containing no more than a specified number of elements, in order.

      Type Parameters

      • T

      Parameters

      • arr: readonly T[]

        The array to be split

      • chunkSize: number

        The maximum number of elements in each chunk

      Returns T[][]

      The array of chunks, where the last chunk may contain fewer elements if the input array length is insufficient.