• Returns an iterator over the next 'count' items of the iterator.

    Note that, for performance reasons, this only accepts an iterator as the 'it' argument. All the other module functions accept iterables.

    You can convert any iterable to an iterator using the iter funtion as shown in the following example.

    If a firstValue is specified, it will be yielded first.

    Parameters

    • it: Iterator<any, any, undefined>
    • count: number
    • Optional firstValue: any

    Returns Generator<any, void, unknown>

    Example

    import { nextItems, iter } from 'deleight/generational';
    const it = iter([1, 'a', 2, 'b', 3, 'c', 4, 'd']);
    const [num, let] = next(it, 2);