splitInto

Splits the input array into at most count chunks.

Type

type splitInto = <E>(count: number) => (array: E[]) => E[][]

Example

import {splitInto} from 'fnxt/array';

const array = [1, 2, 3, 4, 5, 6, 7];
const splitInto = splitInto(3);
splitInto(array)// -> [[1, 2, 3], [4, 5], [6, 7]]

See Also