Splits an array into chunks of a specified size.

  • Type Parameters

    • T

    Parameters

    • array: T[]

      The array to split into chunks.

    • chunkSize: number

      The size of each chunk.

    Returns T[][]

    An array of arrays, each containing a chunk of the original array.