• Returns a generator of arrays with the next 'count' items of the given iterable. In other words, this function will partition the input iterable with each partition containing count items.

    Parameters

    • it: Iterable<any>
    • count: number

    Returns Generator<any[], void, unknown>

    Example

    import { forNext } from 'deleight/generators';
    const it = [1, 'a', 2, 'b', 3, 'c', 4, 'd'];
    const it2 = forNext(it, 2); // (1, 'a'), (2, 'b'), ...