Function chunk

  • Creates an array of elements split into groups of length size. If array can't be split evenly, the final chunk will be the remaining elements.

    Type Parameters

    • Item

      Type of the array elements.

    Parameters

    • array: Item[]

      The array to process.

    • size: number

      The length of each chunk.

    Returns Item[][]

    The new array of chunks.

Generated using TypeDoc