Function splitArray

  • Split array into chunks

    Type Parameters

    • T

    Parameters

    • array: T[]
    • chunkSize: number

    Returns T[][]

    Example

    // returns [ ['a', 'b', 'c'], ['d', 'e', 'f'] ]
    splitArray(['a', 'b', 'c', 'd', 'e', 'f'], 3);