Function chunk

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

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to process

    • size: number = 1

      The length of each chunk

    Returns T[][]

    the new array of chunks.

Generated using TypeDoc