# Function chunk

Splits up an array or string into chunks of the given size.

#### Param: array

The array or string to split.

#### Param: size

The chunk size.

- chunk(str, size): string[]

- Splits up a string into chunks of the given size.

  #### Parameters

  - str: string

    The string to split.

  - size: number

    The chunk size.

  #### Returns string[]

- chunk<T>(array, size): T[][]

- Splits up an array into chunks of the given size.

  #### Type Parameters

  - T

  #### Parameters

  - array: T[]

    The array to split.

  - size: number

    The chunk size.

  #### Returns T[][]